| J2EE[tm] Blueprints > Java[tm] Pet Store > Building the application and Javadocs |
We use Ant to build the source code. Ant is a Java-based build tool like make, which has been developed under the auspices of the Apache Software Foundation. A working version of Ant is provided as part of the J2EE Blueprints bundle.
|
Note: The J2EE Blueprints bundle comes with a pre-built version of the Java Pet Store. To deploy that version and avoid building the application, consult the installation instructions. |
|
Note: The Java Pet Store Javadocs are also available on the Web. Look at these if you don't want to rebuild the Javadocs. |
|
Note: These instructions use $JPS_HOME (UNIX) and %JPS_HOME% (Win32) to
denote the root directory of the J2EE Blueprints bundle. |
The source code is located in the
$JPS_HOME/src/petstore/src/ (UNIX) or
%JPS_HOME%\src\petstore\src\ (Win32).
To build the source using Ant, bring up a shell or command prompt. Then:
UNIX: Change the current directory to
$JPS_HOME/src/petstore/src/ and run
build.sh. If the compilation succeeds,
petstore.ear will be created in the directory
$JPS_HOME/src/petstore/build/.
Win32: Change the current directory to
%JPS_HOME%\src\petstore\src\ and run
build.bat. If the compilation succeeds,
petstore.ear will be created in the directory
%JPS_HOME%\src\petstore\build\.
When deploying the built application, use the file
petstore.ear created by the build (as opposed to
pre-built one located in the root directory of the J2EE Blueprints
bundle).
To build the application Javadocs using Ant, bring up a shell or command prompt. Then:
UNIX: Change the current directory to
$JPS_HOME/src/petstore/src/ and run build.sh
javadocs. If the build succeeds, a folder docs
containing the Javadocs will be created in the directory
$JPS_HOME/src/petstore/build/.
Win32: Change the current directory to
%JPS_HOME%\src\petstore\src\ and run build.bat
javadocs. If the build succeeds, a folder docs
containing the Javadocs will be created in the directory
%JPS_HOME%\src\petstore\build\.
To build a component's Javadocs using Ant, go to its
src subfolder and execute the Javadoc build target for
that component. For example, if you want to build the Javadocs for the
customer component, then:
UNIX: Change the current directory to
$JPS_HOME/src/components/customer/src/ and run
build.sh javadocs. If the build succeeds, a folder
docs containing the Javadocs will be created in the
directory
$JPS_HOME/src/components/customer/build/.
Win32: Change the current directory to
%JPS_HOME%\src\components\customer\src\ and run
build.bat javadocs. If the build succeeds, a folder
docs containing the Javadocs will be created in the
directory
%JPS_HOME%\src\components\customer\build\.