maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Dinn (JIRA)" <>
Subject [jira] [Created] (MJAVADOC-488) Latest jdk9 version causes StringIndexOutOfBoundsException
Date Mon, 03 Jul 2017 10:35:00 GMT
Andrew Dinn created MJAVADOC-488:

             Summary: Latest jdk9 version causes StringIndexOutOfBoundsException
                 Key: MJAVADOC-488
             Project: Maven Javadoc Plugin
          Issue Type: Bug
    Affects Versions: 2.10.4
            Reporter: Andrew Dinn

The latest jdk9 releases (9+176) form the Oracle early access program omits the -ea suffix
which was present in previous releases (e.g. 9-ea+170). This is causing the javadoc plugin
to throw a StringIndexOutOfBoundsException under org.apache.commons.lang.SystemUtils.<clinit>().
Here is the relevant exception backtrace:


[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.4:jar (javadoc-jar)
on project byteman-root: Execution javadoc-jar of goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.4:jar
failed: An API incompatibility was encountered while executing org.apache.maven.plugins:maven-javadoc-plugin:2.10.4:jar:
java.lang.ExceptionInInitializerError: null

[WARNING] Error injecting: org.apache.maven.plugin.javadoc.JavadocJar
        at org.apache.maven.plugin.javadoc.AbstractJavadocMojo.<clinit>(
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(
        . . .
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(
Caused by: java.lang.StringIndexOutOfBoundsException: begin 0, end 3, length 1
        at java.base/java.lang.String.checkBoundsBeginEnd(
        at java.base/java.lang.String.substring(
        at org.apache.commons.lang.SystemUtils.getJavaVersionAsFloat(
        at org.apache.commons.lang.SystemUtils.<clinit>(
        ... 58 more

After stripping the +nnn suffix SystemUtils assumes it has at least 3 characters to play with
(looking at the line number 1133 foir the substring call this appears to be version 2.4 that
is being linked). It seems that this worked by fluke when the string contained the "-ea" suffix
but it now thoroughly borked. Perhaps an upgrade to 2.6 might work?

This message was sent by Atlassian JIRA

View raw message