Uploaded image for project: 'Gradle'
  1. Gradle
  2. GRADLE-1871

Parsing bug in org.gradle.wrapper.GradleWrapperMain

    XMLWordPrintable

    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.

        Attachments

          Activity

            People

            Assignee:
            ldaley Luke Daley
            Reporter:
            blaine Blaine Simpson
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: