Extended Ant Support - overview
You can use the Run ANT option to check your build environment or use the command line batch file provided for repetitive builds.
For detailed explanations, see the series of articles, "Using Ant with WebSphere Studio Application Developer" (Part 2 focuses on the ANT Task specifics for J2EE operations).
In the root of the com.ibm.etools.j2ee.ant plugin is a sample batch file called runANT.bat. This batch file runs a "headless" workspace, and it runs a specified ANT script file (example.xml). The ANT script file must be a fully qualified name.
Edit the runANT.bat file and change the variables to the correct location for your WebSphere Studio installation. This file needs to be updated to run this plugin from the command line.
If you do not specify a build file, runANT will prompt you when you execute the file. You can then select ANT, list all projects, and quit. When you specify the build file, it is relative to the project so enter project name\buildfile name. Note that this is case sensitive.
After you list the projects available, select the ANT option and type in your build filename. You then need to quit manually when the script is finished or specify another project. The projects must all be relative to the same workspace.
Also included is an example.xml file which shows how to use some of the tasks provided through ANT. Please refer to example.xml and runANT.bat for more information. Note that the tasks themselves are case sensitive but the parameters available on each task are not.
Hints and Tips
- When creating an ANT Script, logical order is important. For example, if you are exporting an Enterprise Application that contains enterprise beans, you should generate deployment code for your EJB before exporting. Your XML should look like this:
<!-- Run ejbDeploy on the EJB project in an EAR file --> <ejbDeploy EJBProject="MinibankEJB" IgnoreErrors="true"/> <!-- Export the Application project as an EAR file --> <earExport EARProjectName="MinibankExample" EARExportFile="f:\temp\sample.ear" ExportSource="true"/>- If you are using the runAnt.bat file to do multiple builds, make sure that change the name of the output in your XML file. If your current build is incomplete or fails in any way, you still have the previous build to work from.
Parent topic
Working with Ant