When I launch $ant -Duser.home=/tmp -f build.xml it should output "/tmp" for provided build.xml, but is uses my real user home instead. The bug seems to be fixed in upstream https://issues.apache.org/bugzilla/show_bug.cgi?id=51792, but I can't found the patch. Reproducible: Always
Created attachment 324730 [details] build.xml
monsieurp@epsilon ~/ant $ ant -version Apache Ant(TM) version 1.9.1 compiled on March 15 2015 monsieurp@epsilon ~/ant $ cat demo.xml <?xml version="1.0" encoding="UTF-8"?> <project default="dist" basedir="." name="Groovy" > <target name="dist" > <echo>home=${user.home}</echo> </target> </project> monsieurp@epsilon ~/ant $ ant -Duser.home=/tmp -f demo.xml Buildfile: /home/monsieurp/ant/demo.xml dist: [echo] home=/tmp BUILD SUCCESSFUL Total time: 0 seconds This bug seems to have been solved in recent versions of Ant. Reopen if you still encounter the issue.