Maven Shared Components

Spaces are incorrectly handled on command line

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: maven-invoker-2.0.9
  • Component/s: maven-invoker
  • Labels:
    None
  • Environment:
    Windows, Maven Invoker Plugin 1.2, Maven Invoker 2.0.8
  • Number of attachments :
    0

Description

The command line used to fork Maven on Windows looks like:

[DEBUG] Executing: cmd.exe /X /C "D:\Programme\Java\maven-2.0.9\bin\mvn.bat -B -e "-Dmaven.repo.local="M:\maven\mojo\javacc-maven-plugin\target\local repo"" -f interpolated-pom.xml -s M:\maven\mojo\javacc-maven-plugin\src\it\settings.xml.interpolated clean compile"

which makes Maven exit with

[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Invalid task 'repo': you must specify a valid lifecycle phase, or a goal in the format plugin:goal or pluginGroupId:pluginArtifactId:pluginVersion:goal

The same invocation on Unix looks like

Executing: /bin/sh -c cd /home/bentmann/maven/javacc-maven-plugin/target/it/jjtree-reactor-build && /usr/local/apache-maven/apache-maven-2.0.9/bin/mvn -B -e '-Dmaven.repo.local="/home/bentmann/maven/javacc-maven-plugin/target/local repo"' -f interpolated-pom.xml -s /home/bentmann/maven/javacc-maven-plugin/src/it/settings.xml.interpolated clean compile

which works.

Maybe we can just simplify the maven-invoker to not add quotes, plexus-utils should handle this automatically.

Issue Links

Activity

Hide
Benjamin Bentmann added a comment -

Hm,

plexus-utils 1.5: passes
[DEBUG] Executing: cmd.exe /X /C '"D:\Programme\Java\maven-2.0.9\bin\mvn.bat -B -X -Dmaven.repo.local="M:\maven\shared\maven-invoker\target\test-classes\test-space-local-repo\repo with spaces" validate"'

plexus-utils 1.5.1: fails
[DEBUG] Executing: cmd.exe /X /C "D:\Programme\Java\maven-2.0.9\bin\mvn.bat -B -X "-Dmaven.repo.local="M:\maven\shared\maven-invoker\target\test-classes\test-space-local-repo\repo with spaces"" validate"

Will be interesting to see whether there is one cmd line to work with both.

Show
Benjamin Bentmann added a comment - Hm,
plexus-utils 1.5: passes
[DEBUG] Executing: cmd.exe /X /C '"D:\Programme\Java\maven-2.0.9\bin\mvn.bat -B -X -Dmaven.repo.local="M:\maven\shared\maven-invoker\target\test-classes\test-space-local-repo\repo with spaces" validate"'

plexus-utils 1.5.1: fails
[DEBUG] Executing: cmd.exe /X /C "D:\Programme\Java\maven-2.0.9\bin\mvn.bat -B -X "-Dmaven.repo.local="M:\maven\shared\maven-invoker\target\test-classes\test-space-local-repo\repo with spaces"" validate"
Will be interesting to see whether there is one cmd line to work with both.
Hide
Benjamin Bentmann added a comment -

Fixed in r661905. Tested on WinXP and Xubuntu with both plexus-utils 1.5 and 1.5.1. Quoting of arguments is now entirely up to Commandline from plexus-utils which hopefully knows how to handle the various platforms/shells.

Show
Benjamin Bentmann added a comment - Fixed in r661905. Tested on WinXP and Xubuntu with both plexus-utils 1.5 and 1.5.1. Quoting of arguments is now entirely up to Commandline from plexus-utils which hopefully knows how to handle the various platforms/shells.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: