Is there an Ant equivalent to the 'profile' concept in Maven?
I'd like to be able to specify a different set of targets to build (out of one Ant file) depending on an argument. So in Maven I can specify a profile and then activate it like so: mvn groupId:artifactId:goal -Denvironment=test
So say my build.xml contains:
<target name="profile1">...</>
and
<target name="profile2">...</>
How could I specify at compile time which I want to execute?
You can pass arguments to ant when you invoke it
ant -DProfile=foo
Then ${Profile}
will substitute for foo
This is a sucky workaround but it should be able to pass arguments via the command line if that is your goal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With