JRE position in Eclipse generated classpath is different from the one used in 
Maven compiler
--------------------------------------------------------------------------------------------

                 Key: MECLIPSE-605
                 URL: http://jira.codehaus.org/browse/MECLIPSE-605
             Project: Maven 2.x Eclipse Plugin
          Issue Type: Bug
          Components: Core : Dependencies resolution and build path (.classpath)
    Affects Versions: 2.7
         Environment: Maven version: 2.0.9
Java version: 1.5.0_17
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
            Reporter: Aziz Joumady
         Attachments: MECLIPSEClasspathTest.zip

*Description*
In Maven (and all command line execution) rt.jar and all Java librairies are in 
first position for class loading purpose. Then follows the classpath defined by 
the user.
In contradiction generated classpath provided to Eclipse and used by it, moves 
the JRE Container to the end of the classpath.
It results a different behavior between Maven compilation and Eclipse 
compilation.

*Use case (see attached sample project) :*
Using {{org.w3c.dom.Element}} interface.
This interface is defined in xerces and Java 1.5.

Let's suppose I have a transitive dependency to xerces 1.4.4. Then the 
{{org.w3c.dom.Element}} interface is different from the one defined in Java 1.5.
(For testing purpose I used a direct dependency in sample project).
By using in the code the method {{getTextContent}} or {{setTextContent}}, it 
will point out the problem.

Then calling the {{mvn compile}} command will finish successfully, whereas in 
Eclipse the build will fail.

*Run the test case*
1/ Download the provided sample project
2/ Run the command {{mvn eclipse:clean eclipse:eclipse compile}}
3/ Open Eclipse & import the generated project
4/ Notice the error 
5/ Open the Java Build Path from project configuration
6/ Move the JRE Container above binaries
7/ Notice that the error is resolved

*Expected modifications*
I expect to have the JRE Container above all dependencies in the generated 
.classpath file of the maven eclipse plugin.
Indeed, defining the JRE Container at the bottom of the librairies looks like 
defining all librairies as bootstrap classpath.

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