user2674724
user2674724

Reputation: 9

how to access the .properties file in ant if it is in different location

<property file="Build.properties"/> 

this is valid if build.properties file is in root of project.now if the Build.properties file is in src folder and build.xml is in root(main project root).then what will be the syntax to access that build.properties file.

Upvotes: 0

Views: 262

Answers (3)

Jayan
Jayan

Reputation: 18468

Other answers are valid. Note that you can pass a property file as ant command line

ant -propertyfile src/build.properties

Upvotes: 0

Kevin Bhuva
Kevin Bhuva

Reputation: 73

You can define property at starting of your ant script. And use ${proj_home}*.properties to access your property file. Hope it helps.

Upvotes: 2

Mukesh Kumar Singh
Mukesh Kumar Singh

Reputation: 653

It can be done by giving in two ways

  1. give the loction in classpath.

  2. <property file="src/build.properties" />

Both of them worked for me.

Upvotes: 2

Related Questions