You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "John Casey (JIRA)" <ji...@codehaus.org> on 2006/03/02 19:35:01 UTC

[jira] Closed: (MNG-1415) quoted arguments are not being protected

     [ http://jira.codehaus.org/browse/MNG-1415?page=all ]
     
John Casey closed MNG-1415:
---------------------------

     Resolution: Fixed
    Fix Version:     (was: 2.0.4)
                 2.0.3

The actual fix was a bit more involved, on two fronts.

First, commons-cli apparently doesn't know what to do with:

"-Dfoo=some bar"

when it sees it, so it balks. I compensated for this by adding my own quoted-argument reconstruction method to the parse() method of the CLIManager in MavenCLI. This will groom out any quotes and re-join quoted arguments that span multiple arg-array elements.

Second, usage of the 'm2' script will still break when using the fix included in the comments of this issue. To handle this, I have had to introduce some fairly shady scripting in the m2 shell script, which *may* need some more tweaking to get right. However, since it's deprecated, IMO we shouldn't go to outrageous lengths to fix it for this issue.

> quoted arguments are not being protected
> ----------------------------------------
>
>          Key: MNG-1415
>          URL: http://jira.codehaus.org/browse/MNG-1415
>      Project: Maven 2
>         Type: Bug

>  Environment: Linux
>     Reporter: Matthew Pocock
>     Assignee: John Casey
>     Priority: Critical
>      Fix For: 2.0.3

>
>
> Arguments with whitespace protected by quotes are broken up into individual arguments by maven. It's not happening inside the mvn script - I've echoed the generated command-line to check that. This same exception is raised regardless of using...
> -x="y z"
> -x=\"y z\"
> -x='y z'
> "-x=y z"
> and several other combinations I can't remember.
> Here's an example failure:
> nmrp3@farnham:~/devel/fluxion/trunk/stack/sql-schema$ ~/m2_home/bin/mvn org.codehaus.mojo:maven-execute-plugin:0.1-SNAPSHOT:resources -Dexecute.class=org.comparagrid.fluxion.sql.schema.OWLFromSchema -Dexecute.args="-baseURI=fish -Xdebug"
> + Error stacktraces are turned on.
> [DEBUG] Building Maven user-level plugin registry from: '/home/nmrp3/.m2/plugin-registry.xml'
> [DEBUG] Building Maven global-level plugin registry from: '/home/nmrp3/m2_home/conf/plugin-registry.xml'
> [INFO] Scanning for projects...
> [DEBUG] Using parent-POM from the project hierarchy at: '../pom.xml' for project: org.comparagrid.fluxion:sql-schema:jar:0.1-SNAPSHOT
> [DEBUG] Skipping disabled repository central
> [DEBUG] Skipping disabled repository central
> [DEBUG] maven-execute-plugin: using locally installed snapshot
> [DEBUG] Retrieving parent-POM from the repository for project: null:maven-execute-plugin:maven-plugin:0.1-SNAPSHOT
> [DEBUG] maven-execute-plugin: using locally installed snapshot
> [INFO] ----------------------------------------------------------------------------
> [ERROR] BUILD FAILURE
> [INFO] ----------------------------------------------------------------------------
> [INFO] Invalid task 'debug': you must specify a valid lifecycle phase, or a goal in the format plugin:goal or pluginGroupId:pluginArtifactId:pluginVersion:goal
> [INFO] ----------------------------------------------------------------------------
> [DEBUG] Trace
> org.apache.maven.BuildFailureException: Invalid task 'debug': you must specify a valid lifecycle phase, or a goal in the format plugin:goal or pluginGroupId:pluginArtifactId:pluginVersion:goal
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1351)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds(DefaultLifecycleExecutor.java:376)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:132)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
>         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)
> [INFO] ----------------------------------------------------------------------------
> [INFO] Total time: < 1 second
> [INFO] Finished at: Thu Nov 03 23:35:37 GMT 2005
> [INFO] Final Memory: 1M/3M
> [INFO] ----------------------------------------------------------------------------

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org