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

Improve ERROR message issued when running maven project in JDK lower than JDK running Jenkins

    Details

    • Type: Improvement
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: maven-plugin
    • Labels:
    • Environment:
      Jenkins 2.19.2 LTS, JDK 1.8.0u111
    • Similar Issues:

      Description

      Jenkins 2.19.2 is running in JDK 1.8.0_111
      A Maven project is configured to run in JDK 1.6. When the job is run an error message is displayed,
      ERROR: ================================================================================
      ERROR: Invalid project setup: hudson/maven/AbstractMavenProcessFactory$ConfigureOriginalJDK : Unsupported major.minor version 51.0
      ERROR: JENKINS-18403JENKINS-28294 JDK 'JDK 1.6' not supported to run Maven projects.
      ERROR: Maven projects have to be launched with a Java version greater or equal to the minimum version required by the master.
      ERROR: Use the Maven JDK Toolchains (plugin) to build your maven project with an older JDK.
      ERROR: Retrying with slave Java and setting compile/test properties to point to /opt/ci/java/x64/jdk1.6.
      ERROR: ================================================================================

      The last line of the error message leads the user to believe that the job is being run in a slave using JDK 1.6. It is not obvious from this error message (at least not to me) that the job is being run in the default JDK (1.8 in our case) and that runtime library (rt.jar) used to validate API calls in the application code will be from the default (1.8) JDK. It would be a little more clear if the last line of the error message read"
      ERROR: Retrying the build using the default JDK (/opt/ci/java/jdk1.8) with the following options:
      ERROR:

      {list of specific options}

        Attachments

          Activity

          Hide
          mlgiroux Michael Giroux added a comment -

          Due to the possible adverse effects of building JDK 1.6 apps in a JDK 1.8 compiler, it would also be nice to have an option to configure the maven project type to fail the build immediately when an incomparable JDK is configured in the job. This would allow a site to cause all builds that are misconfigured to fail immediately until the pom is updated to use toolchains, and the jenkins job is configured to use the default JDK.

          Show
          mlgiroux Michael Giroux added a comment - Due to the possible adverse effects of building JDK 1.6 apps in a JDK 1.8 compiler, it would also be nice to have an option to configure the maven project type to fail the build immediately when an incomparable JDK is configured in the job. This would allow a site to cause all builds that are misconfigured to fail immediately until the pom is updated to use toolchains, and the jenkins job is configured to use the default JDK.

            People

            • Assignee:
              Unassigned
              Reporter:
              mlgiroux Michael Giroux
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: