Optional Ant arg
问题 I would like to have an ant arg value optionally included without having to make 2 targets which would be basically the same except for the extra arg. For example: <target name="A" depends="C">...</target> <target name="B" depends="C">...</target> <target name="C"> <java fork="true" ...> <jvmarg .../> <arg .../> <arg .../> ... # now, if the dependency is from A, no more args # if from B <arg value="xxx"/> </java> </target> 回答1: Rather than depend ing on task C, you could use the Antcall task