StringIndexOutOfBoundsException with -Darguments=" " ----------------------------------------------------
Key: MNG-3994 URL: http://jira.codehaus.org/browse/MNG-3994 Project: Maven 2 Issue Type: Bug Components: Command Line Affects Versions: 2.0.9, 2.0.10 Environment: Java version: 1.5.0_16 OS name: "linux" version: "2.6.26-1-686" arch: "i386" Family: "unix" Reporter: Vincent Ricard When i run the following command i get a StringIndexOutOfBoundsException: mvn -Darguments=" " Note the space: 'arguments' equal double-quote space double-quote Here is the stacktrace (with maven 2.0.10 svn r736029): --------------------------------------------------- constituent[0]: file:/home/ricardvi/Application/maven/lib/maven-2.0.10-uber.jar --------------------------------------------------- java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.AbstractStringBuilder.setLength(AbstractStringBuilder.java:146) at java.lang.StringBuffer.setLength(StringBuffer.java:154) at org.apache.maven.cli.MavenCli$CLIManager.cleanArgs(MavenCli.java:842) at org.apache.maven.cli.MavenCli$CLIManager.parse(MavenCli.java:795) at org.apache.maven.cli.MavenCli.main(MavenCli.java:116) 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:585) 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:375) I'm not sure if it's a bug in cleanArgs method or a bug in the classworlds project... so i report this here. -- 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