-
Bug
-
Resolution: Duplicate
-
Major
-
None
-
Windows
Passing the Hudson env var $WORKSPACE to Ant stopped working. I had my Ant build working and after upgrading, it stopped building in the workspace. After some debugging, it appears that Hudson doesn't replace $WORKSPACE with the env var value when calling Ant. I had to change my Ant script to get ${env.WORKSPACE} instead.
Previously, I had defined the variable in Hudson like this as : myvar=$WORKSPACE and this worked.
Both methods are described here : http://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project#Buildingasoftwareproject-AntScripts
- duplicates
-
JENKINS-1640 Environment variables not passed through to Ant tasks
-
- Closed
-
I am not sure if this is reproducible. In my ANT build script, I put:
<echo message="Property of myvar is: ${myvar}"/>
and I defined the project's properties as:
myvar=$WORKSPACE
and in the build output, it echoes it correctly.
Also, the actual ANT build is run as follows:
ant -file build.xml -Dmyvar=$WORKSPACE
Ah, this might be Windows specific? (I tried on Linux and it works as expected).