multi-module builds don't unpack-dependencies with dependency-maven-plugin:1.0
------------------------------------------------------------------------------

         Key: MDEP-1
         URL: http://jira.codehaus.org/browse/MDEP-1
     Project: Maven 2.x Dependency Plugin
        Type: Bug

 Environment: I'm running on Windows 2003 Server, but I don't think it's 
specific to that.
    Reporter: Dan Fabulich
 Attachments: unpackbug.zip

There seems to be a bug in the dependency-maven-plugin that causes multi-module 
(inheritance) Maven builds to break.
 
In the project I'm working on, I'm using "unpack-dependencies" to unpack the 
dependencies into ${project.build.directory}/classes.  This allows me to 
re-bundle my dependency jars into a single jar, for easier distribution.
 
I've attached a zip file with an example project.  In this project, there's a 
top-level project called "unpackbug" and three sub-level projects, "one", "two" 
and "three".
 
"one" --> "two" --> "three"
 
"one" provides One.java, and has no dependencies.  "two" depends on "one", and 
uses dependency-maven-plugin to unpack dependencies, in order to re-bundle 
"one" in two.jar.  Furthermore, "two" depends on "one" at the "provided" scope, 
in order to ensure that anyone who depends on "two" doesn't get an extra copy 
of "one"; they should only get the copy of "one" bundled with "two".
 
"three" depends on "two", but does *not* depend on "one".
 
If you run "mvn install" from the top-level, the build will fail, because 
"three" can't find "One.java".  If you check the repository, you'll find that 
two-1.0-SNAPSHOT.jar does *not* have a copy of One.java in it.
 
But if you go down into "two" and run "mvn install" in there, you'll find that 
two-1.0-SNAPSHOT.jar *does* have a copy of One.java in it.  Now our build of 
"three" will succeed.  You can now go back up to the top and run "mvn install" 
from the top and it will work.
 
I've watched this happen in a debugger...  The problem here is that 
MavenProject.getArtifacts() (for some reason) doesn't return any artifacts for 
"one" when running in a multi-module build, but it does return artifacts for 
"one" when running in a single-module build of "two". 

I haven't attached a JUnit test case, but I have attached an example test 
project, which I hope counts as "testcase included".  :-)


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to