You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Emmanuel Bourg (JIRA)" <ji...@codehaus.org> on 2008/07/28 18:14:27 UTC

[jira] Created: (MANT-46) mvn ant:ant throws a StringIndexOutOfBoundsException

mvn ant:ant throws a StringIndexOutOfBoundsException
----------------------------------------------------

                 Key: MANT-46
                 URL: http://jira.codehaus.org/browse/MANT-46
             Project: Maven 2.x Ant Plugin
          Issue Type: Bug
    Affects Versions: 2.1
            Reporter: Emmanuel Bourg


I'm trying to generate a Ant build from the Maven 2 POM of Commons CLI but I get a StringIndexOutOfBoundsException. I don't know what this is supposed to mean.

Here is the trace:

{noformat}
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-ant-plugin:2.1:ant' -->
[DEBUG]   (f) localRepository = [local] -> file://C:\Documents and Settings\Smanux\.m2\repository
[DEBUG]   (f) overwrite = true
[DEBUG]   (f) project = MavenProject: commons-cli:commons-cli:1.2-SNAPSHOT @ C:\dev\jakarta\cli\pom.xml
[DEBUG]   (f) remoteRepositories = [[apache.snapshots] -> http://people.apache.org/repo/m2-snapshot-repository, [central] -> http://repo1.maven.org/maven2]
[DEBUG]   (f) settings = org.apache.maven.settings.Settings@1e2befa
[DEBUG] -- end configuration --
[INFO] [ant:ant]
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] String index out of range: -1
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
        at java.lang.String.substring(String.java:1768)
        at java.lang.String.substring(String.java:1735)
        at org.apache.maven.wagon.PathUtils.toRelative(PathUtils.java:434)
        at org.apache.maven.plugin.ant.AntBuildWriter.writeProperties(AntBuildWriter.java:464)
        at org.apache.maven.plugin.ant.AntBuildWriter.writeGeneratedBuildXml(AntBuildWriter.java:266)
        at org.apache.maven.plugin.ant.AntBuildWriter.writeBuildXmls(AntBuildWriter.java:113)
        at org.apache.maven.plugin.ant.AntMojo.execute(AntMojo.java:112)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
{noformat}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MANT-46) mvn ant:ant throws a StringIndexOutOfBoundsException

Posted by "Emmanuel Bourg (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANT-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=143478#action_143478 ] 

Emmanuel Bourg commented on MANT-46:
------------------------------------

It worked, thank you.

I had some troubles getting the jar from the snapshot repository though, the pom has been downloaded correctly, but not the jar. I copied it manually to my local repository.

> mvn ant:ant throws a StringIndexOutOfBoundsException
> ----------------------------------------------------
>
>                 Key: MANT-46
>                 URL: http://jira.codehaus.org/browse/MANT-46
>             Project: Maven 2.x Ant Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Emmanuel Bourg
>            Assignee: Benjamin Bentmann
>             Fix For: 2.1.1
>
>
> I'm trying to generate a Ant build from the Maven 2 POM of Commons CLI but I get a StringIndexOutOfBoundsException. I don't know what this is supposed to mean.
> Here is the trace:
> {noformat}
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-ant-plugin:2.1:ant' -->
> [DEBUG]   (f) localRepository = [local] -> file://C:\Documents and Settings\Smanux\.m2\repository
> [DEBUG]   (f) overwrite = true
> [DEBUG]   (f) project = MavenProject: commons-cli:commons-cli:1.2-SNAPSHOT @ C:\dev\jakarta\cli\pom.xml
> [DEBUG]   (f) remoteRepositories = [[apache.snapshots] -> http://people.apache.org/repo/m2-snapshot-repository, [central] -> http://repo1.maven.org/maven2]
> [DEBUG]   (f) settings = org.apache.maven.settings.Settings@1e2befa
> [DEBUG] -- end configuration --
> [INFO] [ant:ant]
> [INFO] ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] String index out of range: -1
> [INFO] ------------------------------------------------------------------------
> [DEBUG] Trace
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
>         at java.lang.String.substring(String.java:1768)
>         at java.lang.String.substring(String.java:1735)
>         at org.apache.maven.wagon.PathUtils.toRelative(PathUtils.java:434)
>         at org.apache.maven.plugin.ant.AntBuildWriter.writeProperties(AntBuildWriter.java:464)
>         at org.apache.maven.plugin.ant.AntBuildWriter.writeGeneratedBuildXml(AntBuildWriter.java:266)
>         at org.apache.maven.plugin.ant.AntBuildWriter.writeBuildXmls(AntBuildWriter.java:113)
>         at org.apache.maven.plugin.ant.AntMojo.execute(AntMojo.java:112)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
> {noformat}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MANT-46) mvn ant:ant throws a StringIndexOutOfBoundsException

Posted by "Emmanuel Bourg (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANT-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=143373#action_143373 ] 

Emmanuel Bourg commented on MANT-46:
------------------------------------

I'm not sure to know how to add a test case for a Maven plugin. The easiest way to reproduce this I guess is to check out the Commons CLI project and issue the mvn ant:ant command. The SVN repository is located there:

http://svn.apache.org/repos/asf/commons/proper/cli/branches/cli-1.x


> mvn ant:ant throws a StringIndexOutOfBoundsException
> ----------------------------------------------------
>
>                 Key: MANT-46
>                 URL: http://jira.codehaus.org/browse/MANT-46
>             Project: Maven 2.x Ant Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Emmanuel Bourg
>
> I'm trying to generate a Ant build from the Maven 2 POM of Commons CLI but I get a StringIndexOutOfBoundsException. I don't know what this is supposed to mean.
> Here is the trace:
> {noformat}
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-ant-plugin:2.1:ant' -->
> [DEBUG]   (f) localRepository = [local] -> file://C:\Documents and Settings\Smanux\.m2\repository
> [DEBUG]   (f) overwrite = true
> [DEBUG]   (f) project = MavenProject: commons-cli:commons-cli:1.2-SNAPSHOT @ C:\dev\jakarta\cli\pom.xml
> [DEBUG]   (f) remoteRepositories = [[apache.snapshots] -> http://people.apache.org/repo/m2-snapshot-repository, [central] -> http://repo1.maven.org/maven2]
> [DEBUG]   (f) settings = org.apache.maven.settings.Settings@1e2befa
> [DEBUG] -- end configuration --
> [INFO] [ant:ant]
> [INFO] ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] String index out of range: -1
> [INFO] ------------------------------------------------------------------------
> [DEBUG] Trace
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
>         at java.lang.String.substring(String.java:1768)
>         at java.lang.String.substring(String.java:1735)
>         at org.apache.maven.wagon.PathUtils.toRelative(PathUtils.java:434)
>         at org.apache.maven.plugin.ant.AntBuildWriter.writeProperties(AntBuildWriter.java:464)
>         at org.apache.maven.plugin.ant.AntBuildWriter.writeGeneratedBuildXml(AntBuildWriter.java:266)
>         at org.apache.maven.plugin.ant.AntBuildWriter.writeBuildXmls(AntBuildWriter.java:113)
>         at org.apache.maven.plugin.ant.AntMojo.execute(AntMojo.java:112)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
> {noformat}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MANT-46) mvn ant:ant throws a StringIndexOutOfBoundsException

Posted by "Vincent Siveton (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANT-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=143370#action_143370 ] 

Vincent Siveton commented on MANT-46:
-------------------------------------

Could you add a test case?

> mvn ant:ant throws a StringIndexOutOfBoundsException
> ----------------------------------------------------
>
>                 Key: MANT-46
>                 URL: http://jira.codehaus.org/browse/MANT-46
>             Project: Maven 2.x Ant Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Emmanuel Bourg
>
> I'm trying to generate a Ant build from the Maven 2 POM of Commons CLI but I get a StringIndexOutOfBoundsException. I don't know what this is supposed to mean.
> Here is the trace:
> {noformat}
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-ant-plugin:2.1:ant' -->
> [DEBUG]   (f) localRepository = [local] -> file://C:\Documents and Settings\Smanux\.m2\repository
> [DEBUG]   (f) overwrite = true
> [DEBUG]   (f) project = MavenProject: commons-cli:commons-cli:1.2-SNAPSHOT @ C:\dev\jakarta\cli\pom.xml
> [DEBUG]   (f) remoteRepositories = [[apache.snapshots] -> http://people.apache.org/repo/m2-snapshot-repository, [central] -> http://repo1.maven.org/maven2]
> [DEBUG]   (f) settings = org.apache.maven.settings.Settings@1e2befa
> [DEBUG] -- end configuration --
> [INFO] [ant:ant]
> [INFO] ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] String index out of range: -1
> [INFO] ------------------------------------------------------------------------
> [DEBUG] Trace
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
>         at java.lang.String.substring(String.java:1768)
>         at java.lang.String.substring(String.java:1735)
>         at org.apache.maven.wagon.PathUtils.toRelative(PathUtils.java:434)
>         at org.apache.maven.plugin.ant.AntBuildWriter.writeProperties(AntBuildWriter.java:464)
>         at org.apache.maven.plugin.ant.AntBuildWriter.writeGeneratedBuildXml(AntBuildWriter.java:266)
>         at org.apache.maven.plugin.ant.AntBuildWriter.writeBuildXmls(AntBuildWriter.java:113)
>         at org.apache.maven.plugin.ant.AntMojo.execute(AntMojo.java:112)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
> {noformat}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MANT-46) mvn ant:ant throws a StringIndexOutOfBoundsException

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MANT-46?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann closed MANT-46.
---------------------------------

         Assignee: Benjamin Bentmann
       Resolution: Fixed
    Fix Version/s: 2.1.1

Fixed in [r680669|http://svn.apache.org/viewvc?view=rev&revision=680669], snapshot deployed.

> mvn ant:ant throws a StringIndexOutOfBoundsException
> ----------------------------------------------------
>
>                 Key: MANT-46
>                 URL: http://jira.codehaus.org/browse/MANT-46
>             Project: Maven 2.x Ant Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Emmanuel Bourg
>            Assignee: Benjamin Bentmann
>             Fix For: 2.1.1
>
>
> I'm trying to generate a Ant build from the Maven 2 POM of Commons CLI but I get a StringIndexOutOfBoundsException. I don't know what this is supposed to mean.
> Here is the trace:
> {noformat}
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-ant-plugin:2.1:ant' -->
> [DEBUG]   (f) localRepository = [local] -> file://C:\Documents and Settings\Smanux\.m2\repository
> [DEBUG]   (f) overwrite = true
> [DEBUG]   (f) project = MavenProject: commons-cli:commons-cli:1.2-SNAPSHOT @ C:\dev\jakarta\cli\pom.xml
> [DEBUG]   (f) remoteRepositories = [[apache.snapshots] -> http://people.apache.org/repo/m2-snapshot-repository, [central] -> http://repo1.maven.org/maven2]
> [DEBUG]   (f) settings = org.apache.maven.settings.Settings@1e2befa
> [DEBUG] -- end configuration --
> [INFO] [ant:ant]
> [INFO] ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] String index out of range: -1
> [INFO] ------------------------------------------------------------------------
> [DEBUG] Trace
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
>         at java.lang.String.substring(String.java:1768)
>         at java.lang.String.substring(String.java:1735)
>         at org.apache.maven.wagon.PathUtils.toRelative(PathUtils.java:434)
>         at org.apache.maven.plugin.ant.AntBuildWriter.writeProperties(AntBuildWriter.java:464)
>         at org.apache.maven.plugin.ant.AntBuildWriter.writeGeneratedBuildXml(AntBuildWriter.java:266)
>         at org.apache.maven.plugin.ant.AntBuildWriter.writeBuildXmls(AntBuildWriter.java:113)
>         at org.apache.maven.plugin.ant.AntMojo.execute(AntMojo.java:112)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
> {noformat}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira