Red Hat Bugzilla – Bug 863005
ant overrides ANT_HOME
Last modified: 2016-01-31 20:57:14 EST
Created attachment 621431 [details]
Description of problem:
Ant overrides ANT_HOME in /etc/ant.conf
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. export ANT_HOME=/some/path/ant-other-version
3. note that the system packaged 1.8.3 runs instead of (or interferes with) the old version
Ant runs with ANT_HOME=/usr/share/ant
Ant should run with the ANT_HOME exported from the shell.
The attached replacing /etc/ant.conf with the attached file fixes the problem by checking if ANT_HOME is set before overriding it. Also, if ANT_HOME has a user-provided value, rpm_mode should probably be false.
exporting ANT_HOME does not change your PATH so calling ant will still start /usr/bin/ant.
If you want to use another ant version do export PATH=/path/to/your/new/ant/bin:$PATH
Also you need to provide patches against http://pkgs.fedoraproject.org/cgit/ant.git/.
Also if you look into /usr/bin/ant (which I think you're running) there is
if [ -z "$ANT_HOME" -o "$ANT_HOME" = "/usr/share/ant" ]; then
if [ -f "/etc/ant.conf" ] ; then
and this is what you have done in ant.conf but /etc/ant.conf is sourced only if ANT_HOME is not defined or points to /usr/share/ant so I don't see how does changing ant.conf to consider ANT_HOME help at all.
Ah, sorry. I should just make sure that /some/path/ant-other-version/bin/ant contains a similar conditional and ignores /etc/ant.conf if ANT_HOME is set then.
Yes, that is probably a better solution.
Thank you. I'm closing this issue as NOTABUG.