Information on GlassFish Builds

Also See : Continuous Build Info | V2 Full Instructions| V3 Build Instructions

GlassFish Build Quickstart

This page describes how to build GlassFish V2.1.1, currently the "Trunk" (SJSAS91_FCS_BRANCH) is under development phase. To build GlassFish V3, see here.

Prerequisites to building GlassFish

  • The users must have Maven (1.0.2) installed: This will create the local repository needed by Maven to store GlassFish dependencies.
  • The user must have a login on java.net and must have access to the CVS repository for the GlassFish project.
  • The user must login to the GlassFish CVS repository once (so CVS saves the password in the .cvspass file in the user's
    home directory)
  • J2SE 5.0
    (1.5.0_11) must be installed (you can't use Java SE 6), configured as JAVA_HOME env variable and in your binary path. We recommend that you use the latest GlassFish nightly tested version.
  • Setup cvs client per java.net instructions.
  • Research per client instructions.

GlassFish Build Quickstart Guide

Assuming you have Apache Maven 1.0.2 and JDK 5.0 (1.5.0_11) installed and configured as specified in the prerequisites
above.

  • Checkout glassfish/bootstrap module : This is the top-level build module consisting of building all or subset of the modules.
    % mkdir workspace
    % cd workspace
    % cvs -d :pserver:<userid>@cvs.java.net:/cvs checkout -r SJSAS91_FCS_BRANCH glassfish/bootstrap
  • Configure Build Variables : Create workspace/glassfish/bootstrap/build.properties or for re-usable GlassFish workspace, one-time process is to create ${HOME}/build.properties (Unix) or %HOMEPATH%\build.properties (Windows) and set following variables.
    glassfish.os.name=<OS Name: Possible values- WINNT, SunOS, Linux, SunOS_X86, Darwin>
    glassfish.cvs.username=<java.net id>

Following two variables don't need to be configured, this is just for information. Default values are set to:

glassfish.root=$\{basedir}/../..  (basedir -directory points to where project.xml is present)
glassfish.home=${glassfish.root}/publish/glassfish => e.g.  /workspace/publish/glassfish
  • Checkout the sources :
    GlassFish workspace has option to build all the modules or subset of modules. Usually developers want to checkout and build only their required modules, so in such situations checkout out subset of modules make sense. But if you are making major integrations including adding/deleting class/module, new feature etc then, you need to checkout and build all the modules so that intermodule dependencies are verified.
  • If you want to checkout subset of modules that you want to develop, use -Dmodules= flag.
    % maven -Dmodules=mail,activation checkout
  • Build the sources: After you checkout sources using Step 3, developer can select the option of "bootstrap" which downloads the pre-built server and builds only subset of the modules. Other option "bootstrap-all" is to create the server from scratch (this requires to checkout all the modules using "maven checkout"), and build all the modules to verify the intermodule or binary dependencies version change.
  • bootstrap-all option: Building all the modules from the source.
    % maven bootstrap-all build
  • *bootstrap option: Build your own module using pre-built server
    % maven -Dmodules=mail,activation bootstrap build
  • Configure or Install Server :
    This step will configure or install server to use runtime. This will create the asadmin script, run create-domain, etc which are needed to run the GlassFish server.
  • To create single-instance domain similar to GlassFish V1, run following command.
    % maven configure-runtime (Default is silent installation)
  • To create cluster mode domain of GlassFish V2, run following command:
    % maven configure-cluster
  • Start the Server:
    All GlassFish server commands are located in the ${glassfish.home}/bin directory.
  • To start the server, run following command.
    % asadmin start-domain domain1
  • To stop server, run following command.
    % asadmin stop-domain domain1
  • *Clean Build, Uninstall Server: *
    You can use any of the above three goals during your development process. Update the sources using your favorite IDE,
    2000 and use any of the following commands on already built workspace to bring the workspace to its original stage to rebuild and verify your changes.
  • To clean the modules to delete build generated files like .class, .properties and ready to recompile, run
    following command
    % maven clean (or maven -Dmodules=mail,activation clean)
  • To delete or uninstall the server, that may be corrupted or you want to get new updated server, run following command. This will remove all the scripts and jar files used to run the server. It will remove everything under {{ ${glassfish.home} }} which is
    /workspace/publish/glassfish
    % maven clobber
  • To clean the server configured in step 5 above, use command below to clean the server which deletes Administration Server, domain1 and preserves the server back to original installed stage. (Deletes newly generated token replaced
    files in ${glassfish.home}/bin, config directories.)
% maven clean-config
  • You can use "maven clean-config" if you want to verify your changes related to domain and administration server startup related. "clobber" goal can be used to delete your server to get new server. "clean" can be used to delete build files and ready to compile.
  • Run Quicklook Tests :
    Quicklook Tests are meant to give the developer a way of testing major functionality in the Application Server and of running a sanity check to ensure that nothing major is broken.
  • Checkout the required test failes from glassfish/appserv-tests as below.
% cd glassfish/bootstrap<br>% maven checkout-quicklook
  • Set APS_HOME. This is the directory where you checked out the
    workspace including the workspace root name (e.g. /workspace/glassfish/appserv-tests)
  • Set S1AS_HOME. This is installation directory for the GlassFish Server (e.g. /workspace/publish/glassfish)
  • The installation properties are under ${APS_HOME}/config.properties to match your installation (e.g. admin.password, http.port, etc.). If you changed any default values, edit this config.properties
    file.
  • Make sure the server is NOT running before running the tests, stop the server if its already running.
  • Quicklook: Run the test on Single instance Domain on Domain Admin Server (domain1).
    % cd $APS_HOME<br>% maven runtest

Quicklook for Cluster mode : Run the test on Cluster mode Domain (which is created by using "maven configure-cluster"). This will run test on Remote instance sqe-server, created and managed by nodeagent, sqe-agent that will be automatically created by the following target.

% cd $APS_HOME<br>% maven runtest-ee-standalone

To run both Quicklook types above to verify your changes for all server combinations, use following command (which may take longer sinceits going to run the tests on both, domain1 and sqe-server as above)

% cd $APS_HOME<br>% maven runtest-ee
  • Open the ${APS_HOME}/test_results.html file in a browser and examine the results.
  • You can find the detailed instructions to run Quicklook tests HERE.

See the complete build instructions for details of how to build GlassFish. For Building from branch, see GlassFish Branch build instructions.