I think the problem is the war packaging. Maven doesn't normally pull in
war dependencies transitively because the dependencies are included
inside it. 

The dependency plugin xxx-dependencies goals are asking Maven to do the
resolution and then filters the results, so in this case the transitive
deps are not included. 

One thing you could try is copying the dependencies from Module C's pom
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 [mailto:[EMAIL PROTECTED] 
Sent: Sunday, December 30, 2007 5:53 AM
To: [email protected]
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>${project.build.directory}/${
pom.build.finalName}/download</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 folder,
all
the dependen jar files, except those for module A and B. The transitive
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 that
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 the
"copy" workaround?

Many thanks,

Patrick Vanbrabant
HintTech Internetworking Technologies

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to