Details
-
Type:
Bug
-
Status:
Resolved
-
Resolution: Fixed
-
Affects Version/s: 1.0-milestone-5
-
Fix Version/s: 1.0-milestone-6
Description
"gradle" Bourne script and org.gradle.launcher.GradleMain work just fine.
org.gradle.wrapper.GradleWrapperMain.main(), invoked directly or by "gradlew" Bourne script, when given any command line -P switch with no space between the switch and the name=value and with a capital D in the property name, causes the following (completely wrong) message and exception:
Exception in thread "main" org.gradle.cli.CommandLineArgumentException: No argument was provided for command-line option '-D'.
at org.gradle.cli.CommandLineParser$KnownOptionParserState.onComplete(CommandLineParser.java:414)
at org.gradle.cli.CommandLineParser.parse(CommandLineParser.java:114)
at org.gradle.cli.AbstractCommandLineConverter.convert(AbstractCommandLineConverter.java:33)
at org.gradle.wrapper.GradleWrapperMain.parseSystemPropertiesFromArgs(GradleWrapperMain.java:67)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:46)
Following both work fine:
java -Dorg.gradle.appname=gradlew -classpath /home/blaine/hsqldb/build/gradle/wrapper/gradle-wrapper.jar org.gradle.wrapper.GradleWrapperMain -Pabc=blah gradlew -Pabc=blah
Works fine even if I add on multiple -P switches and task arguments.
Cause the problem by adding a capital D anywhere in the property name. All of the following cause GradleWrapperMain to barf:
- -PD=val
- -PDab=val
- -PaDb=val
- -PadB=val
I can find the coding mistake if you like, but I don't have the time to waste if you will ignore my submittal.
I would add that the capital D can be in either the property name or the value. This command fails with the same error:
gradlew -PtargetEnvironment=DEV serverProject:tomcatDeploy
However this command works:
gradlew -PtargetEnvironment=dEV serverProject:tomcatDeploy