How to make an Eclipse launch configuration that calls ant?

ant, eclipse, java

Solution

When using ant from Eclipse you can use the default shortcut of `ALT+SHIFT+X,Q` to launch the default build configuration for that project.

If you have multiple build configurations that you created from the Run As menu then it will ask you to select one, or it does in Helios.

Also it is easy to run ant from the command line.

I personally also use the EasyShell plugin to be able to quickly launch cmd/cygwin in the project directory from directly in eclipse.

Problem

I build my Eclipse project from ANT. I would also like to use ANT to run it as well. Clicking `build.xml` every time is somewhat annoying. More importantly, I have multiple different ways in which I like to launch it from ant (test, release, etc.). Is there a way I can use ANT for a launch configuration. The other advantage here is that my launch configuration would not depend on Eclipse, so I could use ant from the command line if I wish, with the same results.

Original source