You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Paul Benedict (JIRA)" <ji...@codehaus.org> on 2009/04/27 01:54:45 UTC

[jira] Issue Comment Edited: (MNG-4054) Command Line interprets bogus options

    [ http://jira.codehaus.org/browse/MNG-4054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=174277#action_174277 ] 

Paul Benedict edited comment on MNG-4054 at 4/26/09 6:53 PM:
-------------------------------------------------------------

Brett is right in his analysis. I was partially right. The first character does trigger the correct mode, but the rest is interpreted as a bogus option. Here's a bogus option that puts Maven into offline mode when it should just be rejected outright:

{code}
C:\Workspace\test-4054>mvn -oX validate
Apache Maven 2.1.0 (r755702; 2009-03-18 14:10:27-0500)
Java version: 1.6.0_06
Java home: c:\dev\jdk1.6.0_06\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
[INFO]
NOTE: Maven is executing in offline mode. Any artifacts not already in your local
repository will be inaccessible.

[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO]   Test MNG-4054
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Invalid task 'X': you must specify a valid lifecycle phase, or a goal in the format plugin:goal or pluginGroupId:pluginArtifactId:pluginVersion:goal
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Sun Apr 26 18:48:18 CDT 2009
[INFO] Final Memory: 1M/63M
[INFO] ------------------------------------------------------------------------
{code}

      was (Author: paul4christ79):
    Brett is right in his analysis. I was partially right. The first character does trigger the correct mode, but the rest is interpreted as a bogus option. Here's a bogus option that puts Maven into offline mode when it should just be rejected outright:

{quote}
C:\Workspace\test-4054>mvn -oX validate
Apache Maven 2.1.0 (r755702; 2009-03-18 14:10:27-0500)
Java version: 1.6.0_06
Java home: c:\dev\jdk1.6.0_06\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
[INFO]
NOTE: Maven is executing in offline mode. Any artifacts not already in your local
repository will be inaccessible.

[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO]   Test MNG-4054
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Invalid task 'X': you must specify a valid lifecycle phase, or a goal in the format plugin:goal or pluginGroupId:pluginArtifactId:pluginVersion:goal
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Sun Apr 26 18:48:18 CDT 2009
[INFO] Final Memory: 1M/63M
[INFO] ------------------------------------------------------------------------
{quote}
  
> Command Line interprets bogus options
> -------------------------------------
>
>                 Key: MNG-4054
>                 URL: http://jira.codehaus.org/browse/MNG-4054
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Command Line
>    Affects Versions: 2.0.10, 2.1.0-M1, 3.0-alpha-1, 3.0-alpha-2
>            Reporter: Paul Benedict
>            Assignee: John Casey
>            Priority: Minor
>             Fix For: 2.1.1
>
>
> The command line interpreter obviously only matches against the starting portion of a known option. 
> To execute offline, this is acceptable: mvn -outside
> To execute in debug mode, this is acceptable mvn -XOXOXOXOXOX
> You can do this with any option. Get the first couple letters right and you'll trigger perhaps an unintended option.

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