[
https://jira.codehaus.org/browse/MRELEASE-750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=295121#comment-295121
]
Thomas Baldauf commented on MRELEASE-750:
-----------------------------------------
Hi Robert,
I checked out the current 2.3-SNAPSHOT from
http://svn.apache.org/repos/asf/maven, patched it and deployed a version
2.3-beta1 to our company repository (because release builds will only run
without snapshot dependencies - even plugins, as you might know). That's why I
obfuscated the version number, it would have been misleading otherwise. I'm not
sure if I can reproduce the problem with a small project. The issue occurred
with parent-module-layouted projects, where some modules have a vast amount of
dependencies. Unfortunately, I couldn't figure out what exactly caused the
problem.
However, checking the endIndex as proposed fixes everything - our builds are
running smoothly now :-)
I will create and submit the patch as described. Maybe I can also find a way to
reproduce the problem, but we're quite busy at the moment and time is scarce.
Thank you,
Thomas
> String index out of range: -1 in ReleaseUtils.loadResolvedDependencies() when
> using Parent-Module-Layout
> --------------------------------------------------------------------------------------------------------
>
> Key: MRELEASE-750
> URL: https://jira.codehaus.org/browse/MRELEASE-750
> Project: Maven 2.x Release Plugin
> Issue Type: Bug
> Components: prepare
> Affects Versions: 2.3
> Reporter: Thomas Baldauf
> Attachments: ReleaseUtils.java
>
>
> [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 );
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira