
Chapter 2 Working with Apache Ant
Ant Targets
To build an application using Ant, you can use the command:
ant [-buildfile <filename>.xml] [<targetName>]
The available targets depend on the application server.
PowerDesigner generates an Ant build script including the following targets:
- Standard J2EE application - PowerDesigner generates the following targets:
- help - displays help
- all - Build the entire application
- compile - compiles the entire application
- javadoc - generates Javadocs
- clean - Clean the generated files
- pack - generates the .EAR, .WAR, .JAR files
- verify - verifies the generated .EAR file using the j2eeverifier
- rebuild - Rebuild the entire application
- BEA WebLogic Server - PowerDesigner generates the following additional targets:
- deploy - Deploy J2EE application in BEA WebLogic Server
- –Duser=wxy –Dpassword=wxy deploy - deploys the application, overriding the default user name and password
- IBM WebSphere Application Server - PowerDesigner generates the following additional targets:
- deploy - Deploy J2EE application in IBM WebSphere Server
- –Duser=wxy –Dpassword=wxy deploy - deploys the application, overriding the default user name and password
- Sybase EAServer - PowerDesigner generates the following additional targets:
- deploy - Deploy J2EE application in Sybase EAServer
- –Duser=wxy –Dpassword=wxy deploy - deploys the application, overriding the default user name and password
- Apache Tomcat - PowerDesigner generates the following additional targets:
- deploy - Deploy web applications in Apache Tomcat
- –Duser=wxy –Dpassword=wxy deploy - deploys the application, overriding the default user name and password
- undeploy - Undeploy deployed web applications from Apache Tomcat
- install - Install web applications in Apache Tomcat
- remove - Remove installed web applications from Apache Tomcat
- reload - Reload web applications in Apache Tomcat
- start - Start web applications in Apache Tomcat
- stop - Stop web applications in Apache Tomcat
- list - List installed web applications in Apache Tomcat
Example of result:
ant pack
Buildfile: build.xml
compile:
[echo] Compiling Java classes...
[javac] Compiling 17 source files to E:\EJB Tests\EAServer\Test3\classes
pack:
[echo] Packaging the application...
[war] Building war: E:\EJB Tests\EAServer\Test3\Order3.war
[jar] Building jar: E:\EJB Tests\EAServer\Test3\Order3.jar
[ear] Building ear: E:\EJB Tests\EAServer\Test3\Order3.ear
BUILD SUCCESSFUL
Copyright (C) 2006. Sybase Inc. All rights reserved.
|
|