Uploaded image for project: 'Maven Release Plugin'
  1. Maven Release Plugin
  2. MRELEASE-750

String index out of range: -1 in ReleaseUtils.loadResolvedDependencies() when using Parent-Module-Layout

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3
    • 2.4
    • prepare
    • None
    • Patch

    Description

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.XXX:prepare (default-cli) on project XXX: Execution default-cli of goal org.apache.maven.plugins:maven-release-plugin:2.XXX:prepare failed: String index out of range: -1 -> [Help 1]

      This is happening in org.apache.maven.shared.release.config.ReleaseUtils.loadResolvedDependencies(..),
      line number 250:

      artifactVersionlessKey = propertyName.substring( startIndex, endIndex );

      Apparently endIndex can be -1 under special circumstances. Defensive programming fixes the problem.

      Proposed patch (see attachment):

      if (endIndex > startIndex)

      { artifactVersionlessKey = propertyName.substring( startIndex, endIndex ); }

      else

      { artifactVersionlessKey = propertyName.substring( startIndex ); }

      Attachments

        1. ReleaseUtils.java
          14 kB
          Thomas Baldauf
        2. MNG-750-release.patch
          1 kB
          Thomas Baldauf

        Activity

          People

            rfscholte Robert Scholte
            semeion Thomas Baldauf
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: