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

Unable to build Jenkins with Java 8 set as target version

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Environment:
      Jenkins 2.49, master as of 2017-03-12
    • Similar Issues:

      Description

      Playing with some Java 8 related improvements in Jenkins I've noticed that Jenkins cannot be built with Java 8 set as desired source/target level and it looks somehow tricky.

      [INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ jenkins-core ---
      [INFO] Changes detected - recompiling the module!
      [INFO] Compiling 1048 source files to /home/foo/Code/jenkins/core/target/classes
      [INFO] -------------------------------------------------------------
      [ERROR] COMPILATION ERROR :
      [INFO] -------------------------------------------------------------
      [ERROR] /home/foo/Code/jenkins/core/src/main/java/hudson/model/User.java:[658,22] error: method fromJobs in class RunList<R#2> cannot be applied to given types;
      [ERROR]   required: Iterable<? extends J#1>
        found: Iterable<Job>
        reason: inferred type does not conform to lower bound(s)
          inferred: J#2
          lower bound(s): T,Job
        where J#1,R#1,R#2,J#2,R#3,T are type-variables:
          J#1 extends Job<J#1,R#1> declared in method <J#1,R#1>fromJobs(Iterable<? extends J#1>)
          R#1 extends Run<J#1,R#1> declared in method <J#1,R#1>fromJobs(Iterable<? extends J#1>)
          R#2 extends Run declared in class RunList
          J#2 extends Job<J#2,R#3>
          R#3 extends Run<J#2,R#3>
          T extends J#2
      /home/foo/Code/jenkins/core/src/main/java/hudson/model/Computer.java:[781,22] error: method fromJobs in class RunList<R#2> cannot be applied to given types;
      [INFO] 2 errors
      [INFO] -------------------------------------------------------------
      [INFO] ------------------------------------------------------------------------
      [INFO] Reactor Summary:
      [INFO]
      [INFO] Jenkins main module ................................ SUCCESS [  2.169 s]
      [INFO] Jenkins cli ........................................ SUCCESS [  3.655 s]
      [INFO] Jenkins core ....................................... FAILURE [ 35.684 s]
      [INFO] Jenkins war ........................................ SKIPPED
      [INFO] Tests for Jenkins core ............................. SKIPPED
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE

       Error can be reproduced in my branch.

      As migration to Java 8 is getting closer and closer it would be good to have it solved.

        Attachments

          Issue Links

            Activity

            emszpak Marcin Zajączkowski created issue -
            emszpak Marcin Zajączkowski made changes -
            Field Original Value New Value
            Description Playing with some Java 8 related improvements in Jenkins I've noticed that Jenkins cannot be built with Java 8 set as desired source/target level and it looks somehow tricky.
            {code:java}
            [INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ jenkins-core ---
            [INFO] Changes detected - recompiling the module!
            [INFO] Compiling 1048 source files to /home/foo/Code/jenkins/core/target/classes
            [INFO] -------------------------------------------------------------
            [ERROR] COMPILATION ERROR :
            [INFO] -------------------------------------------------------------
            [ERROR] /home/foo/Code/jenkins/core/src/main/java/hudson/model/User.java:[658,22] error: method fromJobs in class RunList<R#2> cannot be applied to given types;
            [ERROR]   required: Iterable<? extends J#1>
              found: Iterable<Job>
              reason: inferred type does not conform to lower bound(s)
                inferred: J#2
                lower bound(s): T,Job
              where J#1,R#1,R#2,J#2,R#3,T are type-variables:
                J#1 extends Job<J#1,R#1> declared in method <J#1,R#1>fromJobs(Iterable<? extends J#1>)
                R#1 extends Run<J#1,R#1> declared in method <J#1,R#1>fromJobs(Iterable<? extends J#1>)
                R#2 extends Run declared in class RunList
                J#2 extends Job<J#2,R#3>
                R#3 extends Run<J#2,R#3>
                T extends J#2
            /home/foo/Code/jenkins/core/src/main/java/hudson/model/Computer.java:[781,22] error: method fromJobs in class RunList<R#2> cannot be applied to given types;
            [INFO] 2 errors
            [INFO] -------------------------------------------------------------
            [INFO] ------------------------------------------------------------------------
            [INFO] Reactor Summary:
            [INFO]
            [INFO] Jenkins main module ................................ SUCCESS [  2.169 s]
            [INFO] Jenkins cli ........................................ SUCCESS [  3.655 s]
            [INFO] Jenkins core ....................................... FAILURE [ 35.684 s]
            [INFO] Jenkins war ........................................ SKIPPED
            [INFO] Tests for Jenkins core ............................. SKIPPED
            [INFO] ------------------------------------------------------------------------
            [INFO] BUILD FAILURE{code}
             

            As migration to Java 8 is getting closer and closer it would be good to have it solved.
            Playing with some Java 8 related improvements in Jenkins I've noticed that Jenkins cannot be built with Java 8 set as desired source/target level and it looks somehow tricky.
            {code:java}
            [INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ jenkins-core ---
            [INFO] Changes detected - recompiling the module!
            [INFO] Compiling 1048 source files to /home/foo/Code/jenkins/core/target/classes
            [INFO] -------------------------------------------------------------
            [ERROR] COMPILATION ERROR :
            [INFO] -------------------------------------------------------------
            [ERROR] /home/foo/Code/jenkins/core/src/main/java/hudson/model/User.java:[658,22] error: method fromJobs in class RunList<R#2> cannot be applied to given types;
            [ERROR]   required: Iterable<? extends J#1>
              found: Iterable<Job>
              reason: inferred type does not conform to lower bound(s)
                inferred: J#2
                lower bound(s): T,Job
              where J#1,R#1,R#2,J#2,R#3,T are type-variables:
                J#1 extends Job<J#1,R#1> declared in method <J#1,R#1>fromJobs(Iterable<? extends J#1>)
                R#1 extends Run<J#1,R#1> declared in method <J#1,R#1>fromJobs(Iterable<? extends J#1>)
                R#2 extends Run declared in class RunList
                J#2 extends Job<J#2,R#3>
                R#3 extends Run<J#2,R#3>
                T extends J#2
            /home/foo/Code/jenkins/core/src/main/java/hudson/model/Computer.java:[781,22] error: method fromJobs in class RunList<R#2> cannot be applied to given types;
            [INFO] 2 errors
            [INFO] -------------------------------------------------------------
            [INFO] ------------------------------------------------------------------------
            [INFO] Reactor Summary:
            [INFO]
            [INFO] Jenkins main module ................................ SUCCESS [  2.169 s]
            [INFO] Jenkins cli ........................................ SUCCESS [  3.655 s]
            [INFO] Jenkins core ....................................... FAILURE [ 35.684 s]
            [INFO] Jenkins war ........................................ SKIPPED
            [INFO] Tests for Jenkins core ............................. SKIPPED
            [INFO] ------------------------------------------------------------------------
            [INFO] BUILD FAILURE{code}
             Error can be reproduced in my [branch|https://github.com/szpak/jenkins/tree/tech/JENKINS-42709-unableToBuildForJava8].

            As migration to Java 8 is getting closer and closer it would be good to have it solved.
            batmat Baptiste Mathus made changes -
            Assignee Baptiste Mathus [ batmat ]
            batmat Baptiste Mathus made changes -
            Remote Link Cette demande est liée à "core PR-2802 (Lien Web)" [ 15701 ]
            batmat Baptiste Mathus made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            batmat Baptiste Mathus made changes -
            Status In Progress [ 3 ] Open [ 1 ]
            batmat Baptiste Mathus made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            batmat Baptiste Mathus made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            batmat Baptiste Mathus made changes -
            Remote Link Cette demande est liée à "PR-2802 (Lien Web)" [ 15824 ]
            batmat Baptiste Mathus made changes -
            Remote Link Cette demande est liée à "PR-2802 (Lien Web)" [ 15824 ]
            batmat Baptiste Mathus made changes -
            Link This issue relates to JENKINS-27624 [ JENKINS-27624 ]
            batmat Baptiste Mathus made changes -
            Status In Review [ 10005 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]

              People

              • Assignee:
                batmat Baptiste Mathus
                Reporter:
                emszpak Marcin Zajączkowski
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: