Issue Details (XML | Word | Printable)

Key: MNG-3529
Type: Bug Bug
Status: Open Open
Priority: Trivial Trivial
Assignee: Unassigned
Reporter: Sean Bridges
Votes: 2
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Maven 2 & 3

mvn -Da=" " throws an excepltion

Created: 16/Apr/08 11:15 AM   Updated: 09/Mar/10 04:31 PM
Component/s: Command Line
Affects Version/s: 2.0.8
Fix Version/s: 3.0-alpha-8

Time Tracking:
Not Specified

Issue Links:
Duplicate
 
Related
 

Complexity: Intermediate


 Description  « Hide

Doing,

mvn -Da=" "

throws,

---------------------------------------------------
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:793)
at org.apache.maven.cli.MavenCli$CLIManager.parse(MavenCli.java:746)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:100)
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)



Dominic Mitchell added a comment - 24/Nov/08 09:09 AM

I've just seen this as well:

% mvn release:prepare -DscmCommentPrefix='FOO-139 '
---------------------------------------------------
constituent[0]: file:/usr/local/apache-maven-2.0.9/lib/maven-2.0.9-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.MavenCli$CLIManager.cleanArgs(MavenCli.java:824)
        at org.apache.maven.cli.MavenCli$CLIManager.parse(MavenCli.java:777)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:103)
        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:375)

It's quite useful to have a trailing space in the scmCommentPrefix, as otherwise it gets joined up with the automatically generated commit message and looks rather ugly.


Paul Benedict added a comment - 08/Mar/09 08:49 PM

The duplicated issue (MNG-3994) has 2.0.10 has an affected version, but I can't reproduce it using 2.0.10. I tried these commands:

mvn -Da=" "
mvn -Da=""
mvn validate -Da=" "

Brett Porter added a comment - 08/Mar/09 08:56 PM

I can definitely reproduce it here (Mac OS X)


Paul Benedict added a comment - 08/Mar/09 09:58 PM

I wonder if it is an OS-specific issue? I am on Windows. The report indicates a unix problem and OS X is, unless I am mistaken, a port of unix.