Uploaded image for project: 'Maven Enforcer Plugin'
  1. Maven Enforcer Plugin
  2. MENFORCER-274

Use of RequireJavaVersion with Java-9 breaking starting at b175

    XMLWordPrintableJSON

Details

    Description

      The Oracle JDK9 changed from showing a version string of "9-ea" to simply "9" in build 175.

      This caused the RequireJavaVersion rule that was previously working with "9-ea" to start breaking.

      The break may be due to its use of commons-lang:2, rather than commons-lang3:3.5+ where parsing should work for the newer style of Java versions, but not clear why it started to fail now.

      Stack trace is:

      	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:183)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
      	... 20 more
      Caused by: org.apache.maven.plugin.PluginContainerException: An API incompatibility was encountered while executing org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce: java.lang.ExceptionInInitializerError: null
      -----------------------------------------------------
      realm =    plugin>org.apache.maven.plugins:maven-enforcer-plugin:1.4.1
      strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
      urls[0] = file:/home/mint/.m2/repository/org/apache/maven/plugins/maven-enforcer-plugin/1.4.1/maven-enforcer-plugin-1.4.1.jar
      urls[1] = file:/home/mint/.m2/repository/org/codehaus/mojo/extra-enforcer-rules/1.0-beta-6/extra-enforcer-rules-1.0-beta-6.jar
      urls[2] = file:/home/mint/.m2/repository/org/apache/maven/shared/maven-dependency-tree/2.2/maven-dependency-tree-2.2.jar
      urls[3] = file:/home/mint/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
      urls[4] = file:/home/mint/.m2/repository/org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.jar
      urls[5] = file:/home/mint/.m2/repository/org/apache/maven/shared/maven-common-artifact-filters/1.4/maven-common-artifact-filters-1.4.jar
      urls[6] = file:/home/mint/.m2/repository/com/ibm/icu/icu4j/56.1/icu4j-56.1.jar
      urls[7] = file:/home/mint/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
      urls[8] = file:/home/mint/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.jar
      urls[9] = file:/home/mint/.m2/repository/org/slf4j/slf4j-jdk14/1.5.6/slf4j-jdk14-1.5.6.jar
      urls[10] = file:/home/mint/.m2/repository/org/slf4j/jcl-over-slf4j/1.5.6/jcl-over-slf4j-1.5.6.jar
      urls[11] = file:/home/mint/.m2/repository/org/apache/maven/reporting/maven-reporting-api/2.2.1/maven-reporting-api-2.2.1.jar
      urls[12] = file:/home/mint/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.1/doxia-sink-api-1.1.jar
      urls[13] = file:/home/mint/.m2/repository/org/apache/maven/doxia/doxia-logging-api/1.1/doxia-logging-api-1.1.jar
      urls[14] = file:/home/mint/.m2/repository/commons-cli/commons-cli/1.2/commons-cli-1.2.jar
      urls[15] = file:/home/mint/.m2/repository/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar
      urls[16] = file:/home/mint/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
      urls[17] = file:/home/mint/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
      urls[18] = file:/home/mint/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.22/plexus-utils-3.0.22.jar
      urls[19] = file:/home/mint/.m2/repository/commons-lang/commons-lang/2.3/commons-lang-2.3.jar
      urls[20] = file:/home/mint/.m2/repository/org/apache/maven/enforcer/enforcer-api/1.4.1/enforcer-api-1.4.1.jar
      urls[21] = file:/home/mint/.m2/repository/org/apache/maven/enforcer/enforcer-rules/1.4.1/enforcer-rules-1.4.1.jar
      urls[22] = file:/home/mint/.m2/repository/org/beanshell/bsh/2.0b4/bsh-2.0b4.jar
      urls[23] = file:/home/mint/.m2/repository/org/codehaus/plexus/plexus-i18n/1.0-beta-6/plexus-i18n-1.0-beta-6.jar
      urls[24] = file:/home/mint/.m2/repository/org/apache/maven/plugin-testing/maven-plugin-testing-harness/1.3/maven-plugin-testing-harness-1.3.jar
      urls[25] = file:/home/mint/.m2/repository/org/codehaus/plexus/plexus-archiver/2.2/plexus-archiver-2.2.jar
      urls[26] = file:/home/mint/.m2/repository/org/codehaus/plexus/plexus-io/2.0.4/plexus-io-2.0.4.jar
      urls[27] = file:/home/mint/.m2/repository/junit/junit/4.11/junit-4.11.jar
      urls[28] = file:/home/mint/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
      Number of foreign imports: 1
      import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
      
      -----------------------------------------------------
      
      	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:181)
      	... 21 more
      Caused by: java.lang.ExceptionInInitializerError
      	at org.apache.maven.plugins.enforcer.RequireJavaVersion.execute(RequireJavaVersion.java:52)
      	at org.apache.maven.plugins.enforcer.EnforceMojo.execute(EnforceMojo.java:193)
      	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
      	... 21 more
      Caused by: java.lang.StringIndexOutOfBoundsException: begin 0, end 3, length 1
      	at java.base/java.lang.String.checkBoundsBeginEnd(String.java:3116)
      	at java.base/java.lang.String.substring(String.java:1885)
      	at org.apache.commons.lang.SystemUtils.getJavaVersionAsFloat(SystemUtils.java:1122)
      	at org.apache.commons.lang.SystemUtils.<clinit>(SystemUtils.java:818)
      	... 24 more
      

      Attachments

        Issue Links

          Activity

            People

              gboue Guillaume Boué
              ansell Peter Ansell
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: