[
https://jira.codehaus.org/browse/MRELEASE-750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=294985#comment-294985
]
Robert Scholte commented on MRELEASE-750:
-----------------------------------------
Hi Thomas,
the effected version can't be 2.3, because it hasn't been released yet. You
anonymized the log a bit too much, because it the line
{{org.apache.maven.plugins:maven-release-plugin:2.XXX:prepare}} would have
shown me the right version.
You've already found the sources, which means you're only one small step away
from [creating a
patch|http://maven.apache.org/guides/development/guide-m2-development.html#Creating_and_submitting_a_patch].
You don't have to use the commandline, I bet your IDE supports it too. (just a
java-file is very hard to analyze and quite fast out of sync, whereas patches
don't).
You've created a plaster for the issue, but I would like to fix the source:
what caused this Exception? And are you sure it's not the startIndex? Could you
create a very small sample-project to reproduce this issue?
[Here|https://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/prepare/]
are some examples.
> 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