Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-68890

compilation error with core (java11 eclipse compiler)

    XMLWordPrintable

Details

    • 2.358

    Description

      if you use the eclipse compiler to try and build core you see a lot of code failing to compile as there there are classes contained in 2 locations which is illegal (the javac compiler is allowing this - but I believe eclipse is correct in emmitting this error)

      the biggest offender seems to be org.xml.sax.SAXException which is mostly coming from test cases (that use JenkinsRule.createWebClient()

      the error is The package org.xml.sax is accessible from more than one module: <unnamed>, java.xml

      This can be trivially fixed in test code by changing the throws `SAXException to throws EXception however this is not fixing the underlying issue where the classes are in 2 distinct jar files.

      Steps to Reproduce

      clone jenkinsci/jenkins
      import the project into eclipse as a maven project (using m2e)

      Expected results

      The project imports and builds without issue
      This was the case prior to java11 work

      actual results

      The project imports however has a slew of java compilation issues the majority of which are all about importing org.xml.sax.something or org.w3c.someting,

      Note: this could possibly be reproduced by switching maven to use the eclipse compiler also. https://maven.apache.org/plugins/maven-compiler-plugin/non-javac-compilers.html

      Attachments

        Activity

          teilo James Nord added a comment - - edited

          The dependency is seen as
          xml-apis:xml-apis-1.4.01.jar and JDK-11 javax.xml module -> C:\java\jdk-11.0.14.1+1\lib\jrt-fs.jar

          Path to xml-apis is jenkins-test-harness -> serializer -> xml-apis and jenkins-test-hardness -> xml-apis

          teilo James Nord added a comment - - edited The dependency is seen as xml-apis:xml-apis-1.4.01.jar and JDK-11 javax.xml module -> C:\java\jdk-11.0.14.1+1\lib\jrt-fs.jar Path to xml-apis is jenkins-test-harness -> serializer -> xml-apis and jenkins-test-hardness -> xml-apis

          People

            teilo James Nord
            teilo James Nord
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: