maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jean-Noel Rouvignac (JIRA)" <j...@codehaus.org>
Subject [jira] Commented: (MECLIPSE-665) wrong classpath order generated in .classpath file for transitive dependencies
Date Sun, 29 May 2011 19:50:22 GMT

    [ http://jira.codehaus.org/browse/MECLIPSE-665?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=268986#action_268986
] 

Jean-Noel Rouvignac commented on MECLIPSE-665:
----------------------------------------------

I think the issue is not a reverted order for transitive de[endencies, but simply that the
maven eclipse plugin sorts the dependencies alphabetically.

So in my opinion, the current bug is a duplicate of MECLIPSE-388 .

> wrong classpath order generated in .classpath file for transitive dependencies
> ------------------------------------------------------------------------------
>
>                 Key: MECLIPSE-665
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-665
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : Dependencies resolution and build path (.classpath)
>    Affects Versions: 2.8
>         Environment: - OS : windows XP 2002 SP3
> - java version "1.6.0_20"
> Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
> Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)
> - Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)
> Java version: 1.6.0_20
> Java home: C:\homeware\java\jdk1.6.0_20\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
> - Eclipse SDK
> Version: 3.6.0
> Build id: I20100608-0911
> - maven-eclipse-plugin v2.8
>            Reporter: Bruno DOOLAEGHE
>         Attachments: demo-classpath-order.zip, maven-eclipse-plugin_patch_to_2.8.1.zip
>
>
> Hi !
> It seems the generated ".classpath" file has a transitive dependencies order different
from the one defined in the pom.xml.
> In ".classpath", the transitive dependencies are before the refering dependency, while
in maven build, they are correctly after. 
> This is particulary a problem with the "patch jars", containing a small fix for one class,
which is supposed to be just before the original bugged jar in the classpath.
> I have attached a sample illustrating the problem (demo-classpath-order.zip).
> There is a client module (my-client), using a dependency (my-dependency), which has been
patched (my-patched-dependency)
> my-client depends on my-patched-dependency which depends on my-dependency
> my-client is successfully build with maven (mvn clean install). The dependency tree is
as follows :
> [INFO] ------------------------------------------------------------------------
> [INFO] [dependency:tree {execution: default-cli}]
> [INFO] sample:my-client:jar:1.0-SNAPSHOT
> [INFO] \- dependencies:my-patched-dependency:jar:1.0-SNAPSHOT:compile
> [INFO]    \- dependencies:my-dependency:jar:1.0-SNAPSHOT:compile
> [INFO] ------------------------------------------------------------------------
> But if you try to build under eclipse :
> 1) mvn eclipse:eclipse to generate .classpath and .project
> - > clean under eclipse + build all
> ... There is an error "The method m2() is undefined for the type MyService"
> We can see the classpath in .classpath is inverted : 
> <classpath>
>   <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
>   <classpathentry kind="output" path="target/classes"/>
>   <classpathentry kind="var" path="M2_REPO/dependencies/my-dependency/1.0-SNAPSHOT/my-dependency-1.0-SNAPSHOT.jar"/>
>   <classpathentry kind="var" path="M2_REPO/dependencies/my-patched-dependency/1.0-SNAPSHOT/my-patched-dependency-1.0-SNAPSHOT.jar"/>
>   <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
> </classpath>
> my-dependency is before my-patched-dependency ! that's the reason why eclipse can not
build it...
> I tried to fix the maven-eclipse-plugin, to reverse the order (cf. attached file maven-eclipse-plugin_patch_to_2.8.1.zip).
It fixes the problem (but what about the side effect ?)

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

        

Mime
View raw message