Exercise 4: Testing and setting up automatic execution of the Ant script

This exercise shows you how to test the Apache Ant script that publishes a web and a report.

Before you begin, you must complete Exercise 3: Populating the Ant script.

Testing and running the Ant script

To execute your Ant script, follow these steps.
  1. In the Model Explorer or Navigator view, click your publish.xml Ant file.
  2. Right-click Run > Ant Script....
  3. In the dialog box, click on the JRE tab and in the Runtime JRE pane, select Run in same JRE as workspace.
  4. Click Apply.
  5. Click Run to run your Ant script.
Both the published web of HTML pages and the report on the SimpleUMLModel will be generated.

Setting up the Ant script to automatically execute when the project changes

To automatically execute your Ant file when the SimpleUMLModel changes, follow these steps.
  1. Select the SimpleUMLProject project and right-click Properties
  2. In the Properties for SimpleUMLProject dialog box, on the left, click Builders.
  3. In the Builders pane, click New to create a new builder.
  4. In the Choose configuration type dialog box, select Ant Build and click OK.
  5. In the Properties for New_Builder dialog box, type a name, such as publish_builder in the Name field.
  6. For the Buildfile field, click on Browse Workspace and in the Choose location dialog box, select your publish.xml Ant script file and click OK.
  7. Click on the JRE tab and verify the Runtime JRE pane has Run in same JRE as workspace selected.
  8. Click Apply and then OK in the Properties for New_Builder dialog box and then OK in the Properties for SimpleUMLProject dialog box.
The publish.xml Ant script will automatically be executed when the project is updated.

Finish this tutorial by reviewing the materials in the summary.

Feedback
(C) Copyright IBM Corporation 2005. All Rights Reserved.