Maven 2 & 3

StringIndexOutOfBoundsException with -Darguments=" "

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: 2.0.9, 2.0.10
  • Fix Version/s: None
  • Component/s: Command Line
  • Labels:
    None
  • Environment:
    Java version: 1.5.0_16
    OS name: "linux" version: "2.6.26-1-686" arch: "i386" Family: "unix"
  • Complexity:
    Intermediate
  • Number of attachments :
    0

Description

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.

Issue Links

Activity

There are no comments yet on this issue.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: