The Java EE 6 Tutorial, Volume I

ProcedureBuilding, Packaging, and Deploying the simplegreetingExample Using Ant

Follow these instructions to build, package, and deploy the simplegreeting example to the Enterprise Server using Ant.

This procedure builds the application into the tut-install/examples/cdi/simplegreeting/build/web directory and deploys the contents of this directory to the Enterprise Server.

This procedure builds and packages the application into simplegreeting.war, located in tut-install/examples/cdi/simplegreeting/dist/, and deploys this WAR file to the Enterprise Server.

  1. In a terminal window, go to this directory:


    tut-install/examples/cdi/simplegreeting/
  2. Type the following command:


    ant
    

    This command calls the default target, which builds and packages the application into a WAR file, simplegreeting.war, located in the dist directory.

  3. Type the following command:


    ant deploy
    

    simplegreeting.war will be deployed to the Enterprise Server.