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

前端 未结 4 1845
猫巷女王i
猫巷女王i 2021-02-13 14:29

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



        
4条回答
  •  萌比男神i
    2021-02-13 15:10

    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.

提交回复
热议问题