Uploaded image for project: 'Maven Eclipse Plugin (RETIRED)'
  1. Maven Eclipse Plugin (RETIRED)
  2. MECLIPSE-605

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

    XMLWordPrintableJSON

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

        1. MECLIPSEClasspathTest.zip
          2 kB
          Aziz Joumady

        Issue Links

          Activity

            People

              fgiust Fabrizio Giustina
              ajoumady Aziz Joumady
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: