Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
2.7
-
None
-
None
-
Maven version: 2.0.9
Java version: 1.5.0_17
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
Description
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.
Attachments
Attachments
Issue Links
- depends upon
-
MECLIPSE-548 MECLIPSE-442 should be reverted. Classpath container entries should come before 3rd party jars in .classpath
- Closed