Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-13412

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

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: gradle-plugin
    • Labels:
      None
    • Environment:
      Windows Server 2008 R2
      Jenkins 1.424.6
      Jenkins Gradle Plugin 1.12
    • Similar Issues:

      Description

      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.

        Attachments

          Activity

          danielbeck Daniel Beck created issue -
          gbois Gregory Boissinot made changes -
          Field Original Value New Value
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          danielbeck Daniel Beck made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          gbois Gregory Boissinot made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          danielbeck Daniel Beck made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          gbois Gregory Boissinot made changes -
          Status Reopened [ 4 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          danielbeck Daniel Beck made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          scm_issue_link SCM/JIRA link daemon made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 143878 ] JNJira + In-Review [ 190794 ]

            People

            • Assignee:
              gbois Gregory Boissinot
              Reporter:
              danielbeck Daniel Beck
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: