Gradle plugin fails to quote parameters without whitespace when containing input/output redirection symbols, e.g. in XML strings

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      Gradle plugin explicitly passes job parameters to the "cmd.exe /c gradle.bat" call.

      If one of these arguments looks like XML, but does not contain whitespace, it is not quoted. This leads to problems with input/output redirection symbols (less-than, greater-than)

      Example String Parameter value:

      <fail>
      

      Results in the following build output:

      [workspace] $ cmd.exe /C C:\path\to\gradle.bat -Dfoo=<fail> -i && exit %%ERRORLEVEL%%
      The system cannot find the file specified.
      Build step 'Invoke Gradle script' changed build result to FAILURE
      Build step 'Invoke Gradle script' marked build as failure
      Notifying upstream projects of job completion
      

      Real world example:
      Copy artifacts plugin's "Latest successful build" has the value:

      <StatusBuildSelector/>
      

      This results in "File not found" errors on Windows Server. Not tested on Linux.

            Assignee:
            Gregory Boissinot
            Reporter:
            Daniel Beck
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: