Standard Targets

JAM has been designed with a small, easy-to-remember set of standard target names. Standard targets have the following characteristics:

  • They are listed at the top of each JAM module.
  • The have no script in their body, just a list of target dependencies.
  • They are public having a 'description' attribute that shows up in target listings.
  • They control the inclusion and execution order of the support targets.

Standard targets lend JAM flexibility and provide the following advantages:

  • Standard targets are easy to override by copying them to your build file.
  • Support targets are easy to add, remove or replace by changing the depends clause.
  • You don't have to wade through the entire build file to understand how it works.
  • It is easier for people to use a standard set of commands.

Simple Example demonstrates overriding targets.

The next few sections list the standard targets for various categories of JAM modules.

Core Module Standard Targets

The core modules (lib.xml, ejb.xml, webapp.xml, ear.xml) support a subset of the following standard targets:

       clean          - delete all non-source files
       setup          - show important property settings
       gen            - run code generator (XDoclet and/or JavaGen)
       compile        - compile source code
       dist           - package distribution file (jar, war, ear)
       repo           - add distribution to local Maven repository
       default        - default target usually does a clean build: clean, dist
	  

Application Server Standard Targets

J2EE application server modules support the following two tiers of standard targets:

Mandatory server targets:

       deploy         - deploys distribution file to application server
       undeploy       - removes distribution file from application server
       start          - starts application server
       stop           - stops application server
	  

Optional server targets depending on available features:

       fdeploy     - folder deploy loads expanded application to server
       fundeploy   - folder undeploy removes expanded app from server
       redeploy    - server reloads deployed application
       jspc        - server-specific JSP page compiler
       appc        - compile/validate JSP/EJB application		
		

Unit Test Standard Target

The unit testing module (utest.xml) has one standard target:

       test           - runs unit tests located in the test directory
	  

Integration Test Standard Targets

The integration testing modules (itest.xml and ejbtest-cactus.xml) define the following targets:

       itest          - run integration tests located in the test-cactus directory
       itest.dist     - compiles and packages the test code (usually added to the dist target)
		

Automated Testing Standard Target

Integration testing can be packaged, deployed and run automatically using the testcycle.xml module which defines the following target:

       testcycle      - run integration tests, start/stop server as needed
	  

Support Targets

There are many other targets in JAM modules, but they exists to support the standard targets.