You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Marco Ponzi (JIRA)" <ji...@codehaus.org> on 2007/02/21 16:29:28 UTC

[jira] Updated: (MNG-1935) artifact:dependencies does not respect in the generated classpath the order of the dependencies

     [ http://jira.codehaus.org/browse/MNG-1935?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marco Ponzi updated MNG-1935:
-----------------------------

    Attachment: mavenTestClasspath.tgz

I attach a project that demonstrates how this bug is relevant not only for the ant plugin.
See how generated compilation classpath is different running twice the same project (it seems the classpath is build in a non determinstic way!). The tgz includes two logs generated by maven. These two lines are from the diff of the two log files:

< [DEBUG]   (f) classpathElements = [/home/marco/proj/BancaIntesa/MavenChangeManagement/maven/testscripts/sinapsi-provamaven/target/classes, /home/marco/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar, /home/marco/.m2/repository/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar, /home/marco/.m2/repository/log4j/log4j/1.2.8/log4j-1.2.8.jar]
---
> [DEBUG]   (f) classpathElements = [/home/marco/proj/BancaIntesa/MavenChangeManagement/maven/testscripts/sinapsi-provamaven/target/classes, /home/marco/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar, /home/marco/.m2/repository/log4j/log4j/1.2.8/log4j-1.2.8.jar, /home/marco/.m2/repository/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar]

I have run maven like this:
mvn -X compile

I am compiling the software of a customer that includes two jars which include different versions of a certain class. I cannot specify which of the two must appear first in the classpath and be used during the compilation. No ant plugin is involved.


> artifact:dependencies does not respect in the generated classpath the order of the dependencies
> -----------------------------------------------------------------------------------------------
>
>                 Key: MNG-1935
>                 URL: http://jira.codehaus.org/browse/MNG-1935
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Ant tasks, Artifacts and Repositories
>    Affects Versions: 2.0.1
>         Environment: Windows 2005
> Ant 1.6.5
> JDK 1.4.2_10
>            Reporter: Aurélien Lacenaire
>             Fix For: 2.0.x
>
>         Attachments: mavenTestClasspath.tgz
>
>
> For example, if I put the dependencies in this order, in the generated classpath (dependency.classpath) the order of the jars seems to be different :
> <artifact:dependencies pathId="dependency.classpath" filesetId="dependency.fileset" useScope="runtime">
> 	<remoteRepository refid="remote.repository"/>
> 	<dependency groupId="projects" artifactId="abc" version="1.0"/>
> 	<dependency groupId="projects" artifactId="def" version="1.0"/>
> 	<dependency groupId="projects" artifactId="ghi" version="1.0"/>
> </artifact:dependencies>
> the order in the generated classpath dependency.classpath is not the same as :
> <path id="dependency.classpath">
> 	<pathelement location="${jars.location}/abc-1.0.jar"/>
> 	<pathelement location="${jars.location}/def-1.0.jar"/>
> 	<pathelement location="${jars.location}/ghi-1.0"/>
> </path>
> And my projects have to use those jars in a specific order, otherwhise the build fails.

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