Gradle

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
To raise new issues or bugs against Gradle, please use forums.gradle.org.
  • Gradle
  • GRADLE-1871

Parsing bug in org.gradle.wrapper.GradleWrapperMain

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Resolved 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.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • History
  • Activity
  • TeamCity
  • Commits
  • Source
  • Reviews
Hide
Permalink
Darren Evenson added a comment - 03/Nov/11 2:43 PM

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

Show
Darren Evenson added a comment - 03/Nov/11 2:43 PM 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
Hide
Permalink
Blaine Simpson added a comment - 03/Nov/11 2:54 PM

Thanks Darren. I thought to test that too, a couple times, but never remembered it when I had a computer before me.

Show
Blaine Simpson added a comment - 03/Nov/11 2:54 PM Thanks Darren. I thought to test that too, a couple times, but never remembered it when I had a computer before me.

People

  • Assignee:
    Luke Daley
    Reporter:
    Blaine Simpson
Vote (1)
Watch (2)

Dates

  • Created:
    26/Oct/11 7:48 PM
    Updated:
    04/Jan/13 5:10 AM
    Resolved:
    07/Nov/11 8:04 AM
  • Atlassian JIRA (v5.0.3#729-sha1:bf569e4)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Gradle. Try JIRA - bug tracking software for your team.