Crash if command line parameter ends in space
---------------------------------------------

                 Key: MNG-4560
                 URL: http://jira.codehaus.org/browse/MNG-4560
             Project: Maven 2 & 3
          Issue Type: Bug
          Components: Command Line
    Affects Versions: 2.2.1
         Environment: Ubuntu Linux 9.10 on ia32
            Reporter: Johan Walles
            Priority: Minor


I want to pass -DscmCommentPrefix="BUG1234 - " (note the space before the end 
quote) to the release plugin, but that crashes Maven before the plugin code is 
even reached.  Without the space everything works fine (but the resulting 
commit comment looks ugly).

{code}
jo...@transwarp:/localhome/johan/clients/johan/enginfra/sandboxes/johan/punit$ 
mvn "-Dx=endsinspace "
---------------------------------------------------
constituent[0]: file:/opt/maven/lib/maven-2.2.1-uber.jar
---------------------------------------------------
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
        at 
java.lang.AbstractStringBuilder.setLength(AbstractStringBuilder.java:143)
        at java.lang.StringBuffer.setLength(StringBuffer.java:153)
        at org.apache.maven.cli.CLIManager.cleanArgs(CLIManager.java:271)
        at org.apache.maven.cli.CLIManager.parse(CLIManager.java:224)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:119)
        at 
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:376)
{code}


-- 
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

        

Reply via email to