-
Bug
-
Resolution: Fixed
-
Blocker
-
Jenkins 1.654 ; Jenkins 2.0 ; Jenkins 2.1
Ant Plugin 1.2
Windows 7 x86_64 (master and slave)
Apache Ant 1.9.6
I have a parameterized build job that defines multiple string parameters. The main build step in that job is "Invoke Ant".
Even though I do not define any "Properties" under "Invoke Ant", all of my job parameters are being passed to ant using "-D<Name>=<Value>". That is fine, except when one of my string parameters is blank. In that case Jenkins passes ant "-D<Name>=", which causes ant to barf.
If a job parameter is blank then either it should not be passed to ant, or (probably better) a quoted empty string ("") should be passed to ant.
Attached are a trivial ant build.xml and Jenkins config.xml that demonstrate the problem.
Here is a sample Console Output:
Building remotely on iqautobuild14 in workspace F:\Jenkins\workspace\AntJobWithProperty
[AntJobWithProperty] $ cmd.exe /C "F:\Jenkins\tools\hudson.tasks.Ant_AntInstallation\Ant_from_Apache_\bin\ant.bat -DMY_VAR= && exit %%ERRORLEVEL%%"
Missing value for property MY_VAR
Build step 'Invoke Ant' marked build as failure
Finished: FAILURE
Note that this issue appears to be the same as JENKINS-5157 and JENKINS-7204 (among others), but those issues are supposedly fixed already. Either there is a subtle difference here that I do not understand, or Jenkins has suffered a regression.
- is duplicated by
-
JENKINS-34325 Ant plugin regression between release 1.642.4 ant 1.651.1
-
- Resolved
-
- is related to
-
JENKINS-7204 Ant properties are quoted incorrectly on Windows
-
- Closed
-
-
JENKINS-33727 Invoke Ant - Build failed if parameters contain spaces due to changes in quotes since 1.653
-
- Closed
-
- links to
[JENKINS-33712] Empty parameterized build properties not quoted when passed to ant
Link |
New:
This issue is related to |
Assignee | New: Emilio Escobar [ escoem ] |
Status | Original: Open [ 1 ] | New: In Progress [ 3 ] |
Comment | [ [~escoem] FYI another one. ] |
Labels | New: regression |
Priority | Original: Major [ 3 ] | New: Blocker [ 1 ] |
We are facing the same problem after an upgrade to 1.654
This looks like a regression, if I compare the old commands with the new one you can clearly see the difference. Before the command was being extra quoted with single quotes, and an empty value would become an empty string (surrounded by double quotes):
These extra single quotes are gone now, and the empty value is just empty.
I have tried setting both "" and '' as a value. In the first case the resulting command has invalid syntax, in the second case the value was causing problems further down along the line of our process. This means that this bug is a real killer for us, as we can now only delete the parameter completely.