-
Bug
-
Resolution: Fixed
-
Major
-
None
-
Windows Server 2008 R2
Jenkins 1.424.6
Jenkins Gradle Plugin 1.12
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.
It's not just real XML that's a problem here. Values such as `foo>bar` will also get interpreted as output redirection. Example:
This will redirect script.bat -Dfoo output to a file named bar.
The calls in the examples fail, because there's no file named fail or StatusBuildSelector/, but the output issue is still unfixed. While this requires someone to explicitly enter parameter values such as this (instead of plugin use), and I don't have a good example, it should still be fixed.