Rational Developer for System z


J2EE ANT build script

The J2EE ANT build script format is of type J2EEBLD and language J2EEANT. It can be any name up to 8 characters and variables are defined in tagged language format. The build scripts are very similar for JAR, WAR and EAR. The syntax below is shown for a WAR build script. For JAR and EAR build scripts variables are the same, except use EAR_NAME and JAR_NAME instead of WAR_NAME.

<ANTXML>                                                          

<project name="J2EE Project type" default="web-war" basedir=".">      
<property name="env" environment="env" value="env"/>              
<property name="SCLM_ARCHDEF" value="ARCHDEF name"/>                    
<property name="SCLM_ANTXML" value="ANTXML name"/>                    
<property name="SCLM_BLDMAP" value="Include Buildmap"/> 
<property name="JAVA_SOURCE" value="Include Java Source"/>                       
<property name="J2EE_HOME" value="${env.J2EE_HOME}"/>             
<property name="JAVA_HOME" value="${env.JAVA_HOME}"/>             
<property name="CLASSPATH_JARS" value="Classpath Directory location"/>
<property name="CLASSPATH_JARS_FILES" value="Jar/class filenames"/>   
<property name="ENCODING" value="Codepage"/>                                
                                                                  
<!-- WAR file name to be created by this build process -->        
<!-- include suffix of .war                            -->        
<property name="WAR_NAME" value="War name" />             
                                                                  
<path id="build.class.path">                                      
 <pathelement location="."/>                                      
 <pathelement location="${J2EE_HOME}/lib/j2ee.jar"/>              
 <pathelement location="${CLASSPATH_JARS}/jdom.jar"/>             
 <fileset dir="." includes="**/*.jar"/>                           
 <fileset dir="${CLASSPATH_JARS}" includes="**/*.jar, **/*.zip"/> 
</path>                                                           
                                                                 
</ANTXML>

The SCLM build scripts will overlay customer defined variables dynamically on build request when running the ANT build script. These variables are set to the following values:

Variable Value
J2EE Project name Java/J2EE project type being built. This is a temporary project name set in the build script for ANT to use during the build. The values this will be set to are:
  • J2EE EAR Project
  • J2EE WAR Project
  • J2EE EJB Project
  • JAVA Project
This variable is not required to be customized.
ARCHDEF name ARCHDEF name or the ARCHDEF being built
ANTXML name Name of skeleton Ant XML to use for build
Include Buildmap Value of Yes or No. If Yes then include SCLM Build map in MANIFEST directory in JAR, WAR, or EAR. Provides audit and build map of parts included.
Include Java Source Value of Yes or No. If Yes then include Java source in JAR, WAR, or EAR.
Classpath Directory location z/OSĀ® UNIX System services classpath directory used for resolving classpath dependencies during build. All jars located in this directory will be used in the classpath.
Jar/class filenames Names of individual JAR and Class files to be included in the build. This can be in the form of a list thus:
<property name="CLASSPATH_JARS_FILES"
value="V2J4.jar,V2J3.jar" />
Codepage Either ASCII or EBCDIC codepage for JAVA. This is the codepage JAVA source is stored on the z/OS host. For example:
  • For ASCII JAVA Codepage is set to ISO8859-1
  • For EBCDIC JAVA Codepage is set to IBM-1047
Ear_name/ War_name/ Jar_name Name of the created EAR, WAR or JAR

CLASSPATH dependencies

Normally, Java source within an ARCHDEF may have classpath dependencies upon other Java libraries or classes. If these dependencies are on Java components contained within the same ARCHDEF structure, then these classpath dependencies will be resolved as part of the ARCHDEF build (whether build mode is conditional or forced).

However, a J2EE ARCHDEF component may have classpath dependencies on external JARs or even on members contained in other ARCHDEFs. In this case the J2EE build script associated with the ARCHDEF can control classpath dependencies with the following keywords:
CLASSPATH_JARS
This is a directory name in the z/OS Unix System services file system which may include all external dependent JAR files and/or classes for that particular ARCHDEF build.
This directory may be updated with CLASSPATH files via the Client Team function Upload jar files to copy JAR files from the client into the classpath directory. Also available is the function Copy file from SCLM to classpath to copy SCLM stored JAR files into the classpath directory.
Note: This keyword specifies only a single directory. Therefore, if you need to place different files in this directory that have the same original file name, you must rename at least one of the files before or after placing it in the directory to avoid overwriting a file of the same name.
CLASSPATH_JARS_FILES
This keyword can be used to selectively choose individual JAR or class files to be used in the classpath. If this keyword is used, then the listed JAR/class files are retrieved from SCLM, from the J2EEJAR type, or if not located in SCLM then the directory referenced by CLASSPATH_JARS is searched for retrieval. If this keyword is used then only those files listed are used in the classpath.

J2EE sample build scripts

The following topics provide sample build scripts. These have been generated by SCLM Developer Toolkit during the process of adding a project to SCLM. They do not require changes, but you can modify them as needed.

Terms of use | Feedback



This information center is powered by Eclipse technology. (http://www.eclipse.org)