Running Ant in a headless workspace

You can use Ant to run a workbench with no interface and run specified Ant scripts.

In the root of the com.ibm.etools.j2ee.ant plugin is a sample batch file called runANT.bat. This .bat file will run a "headless" workbench (no user interface for the development environment) and run a specified ANT script file (example.xml). The ANT script file must be a fully qualified name.

Using runAnt has two advantages over the org.eclipse.ant.core.antRunner application:

  1. If you run runAnt with no parameters, it will present a simple menu of operations.

    • List your workbench projects

    • Run an Ant script

  2. If you specify parameters, it will pass them to Ant inside the workbench. Try the following command:
    runAnt -buildfile x:\MYWORKSPACE\MYPROJECT\echo.xml echo dir

  3. Then try the command:
    runAnt

  4. Then, you can type either 1 or 2 plus the following:
    -buildfile x:\MYWORKSPACE\MYPROJECT\echo.xml

 

Parent topic

Working with Ant