How to run Ant with a renamed build file in terminal

By default, Ant is looking for a file named build.xml in the current directory. If you don’t want to rename the file or the file is in another directory you can specify the file name or path by using the -buildfile option. You can also use -file or -f to achieve the same behaviour. After the option type the name or directory containing the file.

ant -buildfile foo.xml
ant -file bar/foo.xml
// Ant is looking for the build.xml in this directory
ant -f bar/ 
chevron_left
chevron_right

Leave a comment

Your email address will not be published. Required fields are marked *

Comment
Name
Email
Website

This site uses Akismet to reduce spam. Learn how your comment data is processed.