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
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Copy-groups-of-dependencies-with-dependency-plugin-tp24799996p24805528.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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

Reply via email to