[ 
https://jira.codehaus.org/browse/MASSEMBLY-683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=344308#comment-344308
 ] 

Claus Schrammel commented on MASSEMBLY-683:
-------------------------------------------

Exactly. It seems, that has been fixed in maven-dependency-plugin:2.5.

Interestingly, when calling copy-dependencies, none of the 
maven-dependency-plugin versions copies xercesImpl-2.0.2.

Not even maven-dependency-plugin:2.4, although it shows it in the dependency 
tree, it does not copy it:
{noformat}
C:\tmp\acme.demo\acme.demo.app>mvn 
org.apache.maven.plugins:maven-dependency-plugin:2.4:copy-dependencies
[INFO] Scanning for projects...
[INFO]
...
[INFO] --- maven-dependency-plugin:2.4:copy-dependencies (default-cli) @ app ---
[INFO] Copying lib-a-0.0.1-SNAPSHOT.jar to 
C:\tmp\acme.demo\acme.demo.app\target\dependency\lib-a-0.0.1-SNAPSHOT.jar
[INFO] Copying hamcrest-core-1.3.jar to 
C:\tmp\acme.demo\acme.demo.app\target\dependency\hamcrest-core-1.3.jar
[INFO] Copying junit-4.11.jar to 
C:\tmp\acme.demo\acme.demo.app\target\dependency\junit-4.11.jar
[INFO] Copying xerces-1.4.4.jar to 
C:\tmp\acme.demo\acme.demo.app\target\dependency\xerces-1.4.4.jar
[INFO] Copying log4j-1.2.16.jar to 
C:\tmp\acme.demo\acme.demo.app\target\dependency\log4j-1.2.16.jar
[INFO] Copying lib-b-0.0.1-SNAPSHOT.jar to 
C:\tmp\acme.demo\acme.demo.app\target\dependency\lib-b-0.0.1-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
{noformat}

But maven-assembly-plugin packs xercesImpl-2.0.2 into the zip file:
{noformat}
C:\tmp\acme.demo\acme.demo.app>mvn package
[INFO] Scanning for projects...
[INFO]
...
[INFO] --- maven-dependency-plugin:2.7:copy-dependencies (copy-dependency-jars) 
@ app ---
[INFO] Copying lib-a-0.0.1-SNAPSHOT.jar to 
C:\tmp\acme.demo\acme.demo.app\target\dependency\lib-a-0.0.1-SNAPSHOT.jar
[INFO] Copying xerces-1.4.4.jar to 
C:\tmp\acme.demo\acme.demo.app\target\dependency\xerces-1.4.4.jar
[INFO] Copying log4j-1.2.16.jar to 
C:\tmp\acme.demo\acme.demo.app\target\dependency\log4j-1.2.16.jar
[INFO] Copying lib-b-0.0.1-SNAPSHOT.jar to 
C:\tmp\acme.demo\acme.demo.app\target\dependency\lib-b-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-assembly-plugin:2.4:single (package-zip) @ app ---
[INFO] Reading assembly descriptor: package-zip.xml
[INFO] Building zip: 
C:\tmp\acme.demo\acme.demo.app\target\app-0.0.1-SNAPSHOT-package.zip
[DEBUG] adding directory app-0.0.1-SNAPSHOT/
[DEBUG] adding entry app-0.0.1-SNAPSHOT/README.txt
[DEBUG] adding directory app-0.0.1-SNAPSHOT/lib/
[DEBUG] adding entry app-0.0.1-SNAPSHOT/lib/lib-a-0.0.1-SNAPSHOT.jar
[DEBUG] adding entry app-0.0.1-SNAPSHOT/lib/log4j-1.2.16.jar
[DEBUG] adding entry app-0.0.1-SNAPSHOT/lib/xerces-1.4.4.jar
[DEBUG] adding entry app-0.0.1-SNAPSHOT/lib/lib-b-0.0.1-SNAPSHOT.jar
[DEBUG] adding entry app-0.0.1-SNAPSHOT/lib/xercesImpl-2.0.2.jar
[DEBUG] adding entry app-0.0.1-SNAPSHOT/lib/app-0.0.1-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
{noformat}


> dependencySet includes different versions of same dependency when there is a 
> pom relocation involved
> ----------------------------------------------------------------------------------------------------
>
>                 Key: MASSEMBLY-683
>                 URL: https://jira.codehaus.org/browse/MASSEMBLY-683
>             Project: Maven Assembly Plugin
>          Issue Type: Bug
>          Components: dependencySet
>    Affects Versions: 2.4
>         Environment: Embedded Maven 3.0.4 in Eclipse Kepler and Maven 3.0.4 
> on Jenkins. All on Windows 7 with Oracle JDK 7.
>            Reporter: Claus Schrammel
>            Assignee: Karl-Heinz Marbaise
>         Attachments: acme.demo.zip
>
>
> When dependencySets are resolved, the assembly plugin handles different 
> versions of the same artifact and provides the same result as Maven built-in 
> dependency resolution does.
> But it fails if the artifact is relocated in its pom. The attached example 
> shows this for xerces:xerces.
> The app depends on lib-a, which itself depends on xerces:xerces:1.4.4.
> The app also depends on lib-b, which itself depends on xerces:xerces:2.0.2, 
> but that is relocated to xerces:xercesImpl.
> So the dependencySet on app contains xerces-1.4.4 *and* xercesImpl-2.0.2, 
> causing problems on the classpath of the actual application.
> The demo contains a standard case with 2 different log4j version which is 
> working fine.
> The demo also uses the maven-dependency-plugin that is able to resolve the 
> dependencies correctly. Only xerces-1.4.4 goes into the target/dependency 
> folder.



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Reply via email to