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:
- The workspace is saved after executing the specified build file.
- Autobuild is disabled during Ant script execution as a performance enhancement and to fix a known limitation with org.eclipse.ant.core.antRunner on Linux.
- If you run runAnt with no parameters, it will present a simple menu of operations.
- List your workbench projects
- Run an Ant script
- 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- Then try the command:
runAnt- Then, you can type either 1 or 2 plus the following:
-buildfile x:\MYWORKSPACE\MYPROJECT\echo.xml
Parent topic
Working with Ant