Sunday, 8 February 2015

passing arguments to java program using ANT



my question is really simple, since this is the first time I use ANT for java, and I don't have much experience in xml ( almost 0% experience ), I need to know some things... I already know basic things like specifying a target with a name and a dependency, and I tried running a java program by typing ant in the command prompt and it worked with no problems at all....my question is:


how do I pass an argument to ant without typing "-Dsomething", since that's what everything online is telling me... I need to type an argument as simple as "-p" or "-e" and I want to tell ant to pass these arguments over to the java program when I run it.. When I type something like:



<target name="-e" depends="compile">
<java classname="MainClass">
<arg value="-e"/>
</java>
</target>


and in cmd I type : ant -e , I get help options.. as it appears that -e is predefined for ant... can I override ant arguments or something?? please I'm very new to ant and I really need help... though I'm a java expert :/


No comments:

Post a Comment