Thanks. This almost works. I had to add <includeScope>compile</includeScope> to the third execution.

Now a new problem: it copies over the dependencies with a particular groupId, but not the transitive dependencies. I guess what I really want is jetty plus everything it depends on to go in a directory. Possible without having to list every transitive dependency explicitly?


JeremieB wrote:
Hi,

I think the following configuration should do the trick :
<build>
  <plugins>
    <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.0</version>
        <executions>
          <execution>
            <id>unpack-jetty</id>
            <phase>package</phase>
            <goals>
              <goal>unpack-dependencies</goal>
            </goals>
            <configuration>
              <includeGroupIds>org.mortbay.jetty</includeGroupIds>
              <outputDirectory>target/lib/jetty</outputDirectory>
            </configuration>
          </execution>
          <execution>
            <id>unpack-metro</id>
            <phase>package</phase>
            <goals>
              <goal>unpack-dependencies</goal>
            </goals>
            <configuration>
              <includeGroupIds>com.sun.xml.ws</includeGroupIds>
              <outputDirectory>target/lib/metro</outputDirectory>
            </configuration>
          </execution>
          <execution>
            <id>unpack-others</id>
            <phase>package</phase>
            <goals>
              <goal>unpack-dependencies</goal>
            </goals>
            <configuration>
<excludeGroupIds>org.mortbay.jetty,com.sun.xml.ws</excludeGroupIds>
              <outputDirectory>target/lib</outputDirectory>
            </configuration>
</execution> </executions>
    </plugin>
  </plugins>
</build>

I think also groupIds are exact match, I'm not sure you could use "*" inside
pattern.
It worked for me, but I adapted it to your sample, so you might have to
adjust some bits.

Hope this helps,
Jeremie



Shef wrote:
I'm having a rough time finding the magic syntax to get maven-dependency-plugin to copy dependencies to the right places. What I want to do is:

1. Copy dependencies with common groupIds to particular subdirectories.
2. Copy the rest of the compile-scope dependencies to the main /lib directory.

Example output:

/target
   /lib
     /jetty
       (jetty and transitives go here, groupid="org.mortbay.jetty")
     /metro
       (glassfish and transitives go here, groupid="com.sun.xml.ws")
   commons-collections.jar
   commons-logging.jar
   etc. -- rest of compile-scope dependencies here

I don't want to have to specify every artifact and its version in the configuration, because all that's already in the <dependencies> section of the pom.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to