Maven 2 & 3

Crash if command line parameter ends in space

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Duplicate
  • Affects Version/s: 2.2.1
  • Fix Version/s: None
  • Component/s: Command Line
  • Labels:
    None
  • Environment:
    Ubuntu Linux 9.10 on ia32
  • Complexity:
    Intermediate
  • Testcase included:
    yes
  • Number of attachments :
    0

Description

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

johan@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)

Issue Links

Activity

There are no comments yet on this issue.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: