Building the Examples on the Command-Line Using Ant
Build properties common to all the examples are specified in the build.properties file in the INSTALL/swdp-tutorial-2.0/examples/bp-project/ directory. You must create this file before you can run the examples. We've included a sample file, build.properties.sample, that you should rename to build.properties and edit to reflect your environment. The tutorial examples use the Java BluePrints (http://java.sun.com/reference/blueprints/) build system and application layout structure.
To run the Ant scripts, you must set common build properties in the file INSTALL/swdp-tutorial-2.0/examples/bp-project/build.properties as follows:
- Set the javaee.home property to the location
of your Application Server installation. The build process uses the javaee.home property to include the libraries in JAVAEE_HOME/lib/ in the classpath. All examples that run on
the Application Server include the Java EE library archive, JAVAEE_HOME/lib/javaee.jar, in the build classpath.
Some examples use additional libraries in JAVAEE_HOME/lib/; the required libraries are enumerated in the individual technology
chapters.
Note - On Windows, you must escape any backslashes in the javaee.home property with another backslash or use forward slashes as a path separator. So, if your Application Server installation is C:\glassfish, you must set javaee.home as follows: javaee.home = C:\\glassfish or javaee.home=C:/glassfish.
- Set the webpack.home property to the location of your Sun Web Developer Pack installation.
- Set the webpack.tutorial.home property to the
location of your tutorial. This property is used for Ant deployment and undeployment.
For example, on UNIX: webpack.tutorial.home=/home/username/swdp-tutorial-2.0or on Windows: webpack.tutorial.home=C:/swdp-tutorial-2.0. Do not install the tutorial to a location with spaces in the path.
- If you did not accept the default values for the admin user and password, set the admin.user property to the value you specified when you installed the Application Server. You will also need to set the admin user's password in the passwordfile file in the INSTALL/swdp-tutorial-2.0/bp-project/ directory to the value you specified when you installed the Application Server. You must create this file before you can run the examples. We've included a sample file, passwordfile.sample, that you should rename to passwordfile and edit to reflect the administrative password that you defined.
- If you did not use port 8080, set the domain.resources.port property to the value specified when you installed the Application Server.
Tutorial Example Directory Structure
To facilitate iterative development and keep application source separate from compiled files, the tutorial examples use the Java BluePrints application directory structure.
Each application module has the following structure:
build.xml: Ant build file
src/java: Java source files for the module
src/conf: configuration files for the module, with the exception of web applications
web: JSP and HTML pages, style sheets, tag files, and images
web/WEB-INF: configuration files for web applications
nbproject: NetBeans project files
The Ant build files (build.xml) distributed with the examples contain targets to create a build subdirectory and to copy and compile files into that directory; a dist subdirectory, which holds the packaged module file; and a client-jar directory, which holds the retrieved application client JAR.
Documentation, Support, and Training
The Sun web site provides information about the following additional resources: