maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karl Heinz Marbaise (JIRA)" <j...@codehaus.org>
Subject [jira] (MASSEMBLY-683) dependencySet includes different versions of same dependency when there is a pom relocation involved
Date Sat, 05 Apr 2014 20:08:59 GMT

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

Karl Heinz Marbaise commented on MASSEMBLY-683:
-----------------------------------------------

Hi, now i got your point sorry was a misunderstanding on my site.

Lets dive into it. If i use maven-dependency-plugin:2.4 you will a thing like this:
{code}
$ mvn org.apache.maven.plugins:maven-dependency-plugin:2.4:tree 
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building app 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:2.4:tree (default-cli) @ app ---
[INFO] acme.demo:app:jar:0.0.1-SNAPSHOT
[INFO] +- junit:junit:jar:4.11:test
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- acme.demo:lib-a:jar:0.0.1-SNAPSHOT:compile
[INFO] |  +- log4j:log4j:jar:1.2.16:compile
[INFO] |  \- xerces:xerces:jar:1.4.4:compile
[INFO] \- acme.demo:lib-b:jar:0.0.1-SNAPSHOT:compile
[INFO]    \- xerces:xercesImpl:jar:2.0.2:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
{code}

But if you use maven-dependency-plugin:2.5 you will get the following:
{code}
$ mvn org.apache.maven.plugins:maven-dependency-plugin:2.5:tree 
[INFO] Scanning for projects...
[INFO]                                                                         
...
[INFO] --- maven-dependency-plugin:2.5:tree (default-cli) @ app ---
[INFO] acme.demo:app:jar:0.0.1-SNAPSHOT
[INFO] +- junit:junit:jar:4.11:test
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- acme.demo:lib-a:jar:0.0.1-SNAPSHOT:compile
[INFO] |  +- log4j:log4j:jar:1.2.16:compile
[INFO] |  \- xerces:xerces:jar:1.4.4:compile
[INFO] \- acme.demo:lib-b:jar:0.0.1-SNAPSHOT:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
{code}
If you use maven-dependency-plugin:2.6?2.8 you will get the same results which is related
to [MSHARED-167 |http://jira.codehaus.org/browse/MSHARED-167]


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

Mime
View raw message