0

am working on a java project where am using ant as build tool.

I have two .property files say build_local and build_env. When I build the project through ant it should use build_local properties file and when am building the project for environment it should overwrite the build_local and use build_env.

Thanks in advance for any help. It would be great if you could post some references.

user2821894
  • 988
  • 2
  • 11
  • 20

1 Answers1

0

Have you seen this example where you can pass arguments to ant build file. How do I pass an argument to an Ant task?

So in your case for local build use

ant -Denv=build_local -f your_antfile.xml

For non local files call

 ant -Denv=build_env -f your_antfile.xml

Needless to say in your_antfile.xml you need to refer the properties files as "${env}.properties"

Community
  • 1
  • 1
Reddymails
  • 793
  • 1
  • 10
  • 24