简体   繁体   中英

Passing parameter properly in an Ant task

I have an Ant build file named 'prepare.all.xml' which has the following line:

<import file="${build.config.dir}/prepare.tools.config.xml" description="Standard tool configurations"/>

I am trying to run this build file and the command that I gave is -

ant -buildfile=prepare.all.xml

This threw me an error and the error is:

C:\CIA-TestFramework\build-config\prepare.all.xml:6: Cannot find C:\CIA-TestFramework\buildconfig\${build.config.dir}\prepare.tools.config.xml imported from C:\CIA-TestFramework\build-config\prepare.all.xml

Now the file 'prepare.tools.config.xml' is located in the directory- C:\\CIA-TestFramework\\build-config\\

What should be the command to make this run properly?

The property build.config.dir is not set.
If you want to set it in commandline use :

ant -buildfile=prepare.all.xml -Dbuild.config.dir=whatever

see Ant manual Running Apache Ant for details

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM