-
Bug
-
Resolution: Fixed
-
Critical
-
None
-
Hudson 1.371
Ant 1.7.1
The latest Hudson seems to quote Ant properties incorrectly. Older versions of Hudson did not have the same problem. The quote problem makes it impossible to define an empty Ant property.
Steps to reproduce:
- Create new free style job
- Run the job to create a workspace folder
- Add the following file to the job workspace:
build.xml
<project default="build" basedir="."> <target name="build"> <echo message="Value: '${value}'" /> </target> </project>
- Reconfigure the hudson job to invoke Ant
- In the Ant properties field write:
value=""
- Run the job
Excepted result:
The Ant script should show that the value property was blank
Actual result:
The Ant script show that the value property is actual "".
Additional information:
In the console output of the job Hudson 1.371 displays:
[workspace] $ cmd.exe /C '"ant.bat "-Dvalue=""""" && exit %%ERRORLEVEL%%"'
In the console output of the job in older Hudson's (1.361 and earlier) displayed:
[workspace] $ cmd.exe /C '"ant.bat -Dvalue="" build && exit %%ERRORLEVEL%%"'
- is duplicated by
-
JENKINS-5157 ant issues on empty build parameters
-
- Resolved
-
- is related to
-
JENKINS-7108 Running a parametrized build with Copy Artifact's Build Selector breaks Ant functionality on Windows
-
- Resolved
-
-
JENKINS-2149 Comma in Ant property Field not working
-
- Resolved
-
-
JENKINS-33712 Empty parameterized build properties not quoted when passed to ant
-
- Resolved
-
Defining a property without a value makes the Hudson build fail. If the test is run directly against Ant from a command prompt Ant reports: "Missing value for property value".
Steps:
1) Change the Ant properties to:
Hudson console output:
Single quotes seems to escaped correctly in Hudson. Ant reports the same value in Hudson as when the the script is run from a command prompt.
Hudson console output on single quotes:
Started by user anonymous Building on master [workspace] $ cmd.exe /C '"ant.bat -Dvalue='' && exit %%ERRORLEVEL%%"' Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\lib\tools.jar Buildfile: build.xml build: [echo] Value: '''' BUILD SUCCESSFUL Total time: 0 seconds Finished: SUCCESS