Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-4560

Crash if command line parameter ends in space

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 2.2.1
    • None
    • Command Line
    • None
    • Ubuntu Linux 9.10 on ia32

    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)
      

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            bentmann Benjamin Bentmann
            walles Johan Walles
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment