I set my ANT_OPTS='-propertyfile ant.properties'. ANT does not recognize the comand-line parameter -propertyfile. This is an obvious bug. I suggest that ANT should always accept an optional default property file (possibly ant.properties). ANT should optionally accept also accept ALL command-line parameters on the property file. The ANT_OPTS is difficult to change and manipulate. Also, ANT should accept macro expressions in its property file. It does not accept such expression now. For instance it should accept such thing as: root.path=${basedir}/sources Regards, Colbert Philippe
http://ant.apache.org/manual/running.html#envvars Try using ANT_ARGS.
1. like Conor says, you should be using ant_args; that part of your bugrep is invalid. 2. ant does normally expand properties in its property files, but a quick skim of the source implies that no, we dont seem to be working on -propertyfile expansion. As this is not in the spec, marking it as an enhancement and renaming the bugrep as appropriate.
*** Bug 25546 has been marked as a duplicate of this bug. ***
*** Bug 34144 has been marked as a duplicate of this bug. ***
At minimum, the Ant documentation should warn people that in-line property expansion does not work when -propertyfile is used.
Yeah, this behavior is bothersome and (imho) a bug. I have this in foo.properties: base.path=/base/path deploy.app=foo deploy.path=${base.path}/${deploy.app} I want this at runtime: base.path=/base/path deploy.app=foo deploy.path=/base/path/foo If the Ant xml includes <property file="foo.properties" />, nested properties listed in foo.properties are expanded. If -propertyfile is used, either from the cli @ invocation (ant -f foo.xml target -propertyfile foo.properties) or via ANT_ARGS, the nested properties (i.e. ${deploy.path} do not expand/enumerate/etc. FWIW, running Ant in debug shows that properties slurped in via -propertyfile invocations are set to 'ro project property'. In debug when you call to a property file directly via <property /> in your Ant XML, these are set to 'project property'. This issue manifests in the current release (1.8.1). And nothing in the docs seems to indicate that Ant should behave differently at runtime whether one sets properties via <property ... />, -propertyfile, or -Dproperty.foo, etc.
should work with svn revision 954939