maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian E. Fox" <>
Subject RE: Problem with maven-dependency-plugin: copy-dependencies
Date Mon, 31 Dec 2007 21:16:35 GMT

-----Original Message-----
From: PatrickV [] 
Sent: Sunday, December 30, 2007 2:11 PM
Subject: RE: Problem with maven-dependency-plugin: copy-dependencies

>I changed the packaging of module C into jar, and no difference.
>I think the copy-dependency plugin does not take into account
>on artifacts on the reactor (in this case Module A and Module B), but
>on "real" dependencies from the repositorie.

Not sure what you mean here. If a dependency is listed in the pom, it is
included. There are no other ways for dependencies to be included.
Sharing a reactor has other subtle effects but doesn't change the fact
that a dependency needs to be listed. Perhaps I'm not getting what
you're saying.

"...I don't want to pull in the dependencies of Module C (the war), but
I want to copy all the dependencies
of Module C (including Module A and Module B).."

Huh? You do or don't want the dependencies of Module C?

"to a specific directory, so that later on I can do some additional
processing on it. All dependencies
are there, even the transitive dependencies of module A and module B
are both packaged as Jar), except for ModuleA.jar and ModuleB.jar."

Simply binding copy-dependencies should get you all dependencies of
whatever pom you've put it in. If it's module C, then you'll get all
transitive dependencies of that Module. If you put it in the parent,
chances are that parent doesn't declare dependencies like you want so
you won't get what you want (module != dependency).

Brian E Fox wrote:
> I think the problem is the war packaging. Maven doesn't normally pull
> war dependencies transitively because the dependencies are included
> inside it. 
> The dependency plugin xxx-dependencies goals are asking Maven to do
> resolution and then filters the results, so in this case the
> deps are not included. 
> One thing you could try is copying the dependencies from Module C's
> since the plugin would have knowledge of all the dependencies, or you
> could unpack the war (because presumably the dependencies you need are
> in /lib). (using the latest snapshot, you can filter the contents as
> they are unpacked).
> -----Original Message-----
> From: Patrick Vanbrabant [] 
> Sent: Sunday, December 30, 2007 5:53 AM
> To:
> Subject: Problem with maven-dependency-plugin: copy-dependencies
> Hi,
> I have a multi-module project set up as follows.
> Parent
>     Module A
>        depenencies: x, y,z
>     Module B
>                dependencies: A, y,d,
>     Module C
>                dependencies: A, B, t,u,y
> Each module with its own dependencies.
> Now I want to execute the goal copy-dependencies on module C, but
> through
> the parent pom. So I execute mvn -U package on the parent project.
> The plugin is configured as follows:
> <plugin>
>     <groupId>org.codehaus.mojo</groupId>
>     <artifactId>dependency-maven-plugin</artifactId>
>     <executions>
>         <execution>
>             <id>copy-dependencies</id>
>             <phase>test</phase>
>             <goals>
>                 <goal>copy-dependencies</goal>
>             </goals>
>             <configuration>
>                 <outputDirectory>${}/${
>                 <stripVersion>true</stripVersion>
>                 <overWriteReleases>false</overWriteReleases>
>                 <overWriteSnapshots>false</overWriteSnapshots>
>                     <overWriteIfNewer>true</overWriteIfNewer>
>             </configuration>
>         </execution>
>     </executions>
> </plugin>
> According to the documentation, copy-dependencies should copy the
> project
> dependencies, and its transitive dependencies.
> After the execution of the package stage, I find in the download
> all
> the dependen jar files, except those for module A and B. The
> dependencies of those modules however are present in the download
> folder.
> On more thing to mention is that module C is packages as a war file.
> I have allready tried lots of things (including setting the phase to
> package
> (in which case nothing was copied)). The only thing that works is if I
> use
> an additional goal "copy" and specify the modules as artifacts for
> goal. In this case I have to "install" module A and B in my local
> repository, sonething I think is not necessary nor wanted.
> Anyone any ideas, on how I can achieve my goal, without reverting to
> "copy" workaround?
> Many thanks,
> Patrick Vanbrabant
> HintTech Internetworking Technologies
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View this message in context:
Sent from the Maven - Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message