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

Can't compile/test under Java 10/11 with mvn

    Details

    • Similar Issues:

      Description

      Sample error from workflow-support-plugin:

      [ERROR] java.nio.file.NoSuchFileException:$GIT_REPO/target/classes/META-INF/annotations/hudson.Extension

      (Where $GIT_REPO is the actual folder holding the code). 

        Attachments

          Issue Links

            Activity

            svanoort Sam Van Oort created issue -
            svanoort Sam Van Oort made changes -
            Field Original Value New Value
            Epic Link JENKINS-40689 [ 177392 ]
            svanoort Sam Van Oort made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            svanoort Sam Van Oort made changes -
            Environment Java 10 as JAVA_HOME for Maven
            Hide
            svanoort Sam Van Oort added a comment -

            Annotations folder is indeed empty.   

            I wonder if we might be seeing some flavor of https://issues.apache.org/jira/browse/MCOMPILER-310

            Show
            svanoort Sam Van Oort added a comment - Annotations folder is indeed empty.    I wonder if we might be seeing some flavor of  https://issues.apache.org/jira/browse/MCOMPILER-310
            Hide
            svanoort Sam Van Oort added a comment -

            Per this issue https://github.com/mapstruct/mapstruct/issues/1382 we tried using:  MAVEN_OPTS="--add-modules java.xml.ws.annotation"  to support annotations...

            and it still failed. 

            Show
            svanoort Sam Van Oort added a comment - Per this issue https://github.com/mapstruct/mapstruct/issues/1382  we tried using:  MAVEN_OPTS="--add-modules java.xml.ws.annotation"  to support annotations... and it still failed. 
            svanoort Sam Van Oort made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            jglick Jesse Glick made changes -
            Link This issue is blocked by INFRA-1680 [ INFRA-1680 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "sezpoz PR 13 (Web Link)" [ 20942 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "core PR 3516 (Web Link)" [ 20943 ]
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            I updated to the latest Maven Compiler just in case, no luck

            Show
            oleg_nenashev Oleg Nenashev added a comment - I updated to the latest Maven Compiler just in case, no luck
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            There are org.kohsuke.accmod.Restricted org.kohsuke.stapler.export.ExportedBean in the annotations directory tho. Kinda moving forward

            Show
            oleg_nenashev Oleg Nenashev added a comment - There are org.kohsuke.accmod.Restricted org.kohsuke.stapler.export.ExportedBean in the annotations directory tho. Kinda moving forward
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            sezpoz update in the core resolves the issue, but you always have to run with newer Jenkins Core dependency to get it running

            Show
            oleg_nenashev Oleg Nenashev added a comment - sezpoz update in the core resolves the issue, but you always have to run with newer Jenkins Core dependency to get it running
            oleg_nenashev Oleg Nenashev made changes -
            Assignee Sam Van Oort [ svanoort ] Oleg Nenashev [ oleg_nenashev ]
            oleg_nenashev Oleg Nenashev made changes -
            Remote Link This issue links to "Core PR#3635. master branch (Web Link)" [ 21825 ]
            Hide
            svanoort Sam Van Oort added a comment -

            Oleg Nenashev I swear I had this working after the PRs attached...

            Show
            svanoort Sam Van Oort added a comment - Oleg Nenashev I swear I had this working after the PRs attached...
            oleg_nenashev Oleg Nenashev made changes -
            Summary Can't compile/test under Java 10 with mvn Can't compile/test under Java 10/11 with mvn
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Sam Van Oort I actually compile on Java 11 so my mileage may vary (spoiler: it hurts)

            Show
            oleg_nenashev Oleg Nenashev added a comment - Sam Van Oort I actually compile on Java 11 so my mileage may vary (spoiler: it hurts)
            Hide
            danielbeck Daniel Beck added a comment -

            Addressed in 2.143.

            Show
            danielbeck Daniel Beck added a comment - Addressed in 2.143.
            danielbeck Daniel Beck made changes -
            Status In Review [ 10005 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            oleg_nenashev Oleg Nenashev made changes -
            Labels java10 java10_hackathon java10 java10_hackathon java11
            Hide
            markewaite Mark Waite added a comment -

            Solution in my case (and I believe the general case) to compile with Java 11 needs to use Jenkins version 2.164 or later (slightly older versions can compile with Java 11, Jenkins 2.150 cannot compile with Java 11).

            My command line to compile with Java 11 was:

            $ java -version
            openjdk version "11.0.2" 2019-01-15
            OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
            OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
            $ mvn --version
            Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T18:41:47Z)
            Maven home: /home/jagent/tools/apache-maven-3.6.0
            Java version: 11.0.2, vendor: Oracle Corporation, runtime: /mnt/xvdba/home/jagent/tools/jdk-11.0.2
            Default locale: en_US, platform encoding: UTF-8
            OS name: "linux", version: "2.6.32-754.6.3.el6.x86_64", arch: "amd64", family: "unix"
            $ mvn -Djenkins.version=2.164 clean install
            
            Show
            markewaite Mark Waite added a comment - Solution in my case (and I believe the general case) to compile with Java 11 needs to use Jenkins version 2.164 or later (slightly older versions can compile with Java 11, Jenkins 2.150 cannot compile with Java 11). My command line to compile with Java 11 was: $ java -version openjdk version "11.0.2" 2019-01-15 OpenJDK Runtime Environment 18.9 (build 11.0.2+9) OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode) $ mvn --version Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T18:41:47Z) Maven home: /home/jagent/tools/apache-maven-3.6.0 Java version: 11.0.2, vendor: Oracle Corporation, runtime: /mnt/xvdba/home/jagent/tools/jdk-11.0.2 Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "2.6.32-754.6.3.el6.x86_64", arch: "amd64", family: "unix" $ mvn -Djenkins.version=2.164 clean install

              People

              • Assignee:
                oleg_nenashev Oleg Nenashev
                Reporter:
                svanoort Sam Van Oort
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: