Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify base dir then we run ant like ant -f somedir/dir/build.xml

Tags:

java

ant

How to specify base dir then we run ant like ant -f somedir/dir/build.xml. Ant sets basedir relative to build.xml, if I specify

<project basedir="." ..>

I would like to have basedir pointed to place where Ant is executed.

like image 970
Andrei N Avatar asked Apr 01 '13 14:04

Andrei N


1 Answers

Use -D to override the basedir property:

ant -Dbasedir=`pwd` -f path/to/build.xml

The use of pwd is a Linux-only thing, but you can always put the absolute path of the current directory there if you're on another platform.

I don't think there's a way to do this inside build.xml, short of re-executing ant with the ant task.

like image 93
David North Avatar answered Sep 21 '22 17:09

David North