-
Bug
-
Resolution: Fixed
-
Critical
-
None
-
Platform: All, OS: All
It appears that environment variables available in the Hudson configuration
(i.e. visible in the Hudson System Information page) are NOT passed to Ant
builds when Hudson launches a configured Ant installation.
This does not seem intentional. Is this by design?
For example, I declare an environment variable MYSTERY='This is a puzzler' and
make it available in the shell by which I launch Hudson (java -jar Hudson.war)
I add an <echo> statement in my Ant build script to print out the value of this
env variable. When running Ant outside of Hudson, the value of MYSTERY is
displayed properly. When running Ant inside of Hudson, the value is not
resolved even though Hudson displays the value of MYSTERY properly in the
Environment Variables section of the System Information page.
This seems unexpected.
Is this a known issue?
- is duplicated by
-
JENKINS-6013 Passing Hudson env vars to Ant stopped working
-
- Resolved
-
I dont think it is intentional. But I could not reproduce your problems with 1.213.
The steps I tried to reproduce:
1. Execute "export MYSTERY=WORKSFORME" in shell
2. Start hudson through java -jar hudson.war
3. Create a new job
4. Add a ant builder
5. Put the following ant file into workspace
<?xml version="1.0"?>
<project name="test" default="a" basedir=".">
<target name="a">
<property environment="env" />
<echo message="Mystery=${env.MYSTERY}"/>
</target>
</project>
6. Build and check the console output:
[workspace] $ ant a
Buildfile: build.xml
a:
[echo] Mystery=WORKSFORME
BUILD SUCCESSFUL
Is there something Im missing?