Rational Developer for System z

Building and deploying a J2EE project

This topic describes the mechanics of building, and deploying a J2EE project in Developer Toolkit.

1. Project migration

In Rational® Developer for System z®, it is recommended that each component of your J2EE application is developed separately in a separate project. For example, if you are developing a dynamic Web project, you typically create a new project for such an application. All components of your J2EE application are included in an enterprise application project which includes the deployment descriptor.

For each project, it is recommended you store all components of a project in a separate type in SCLM. For example, if you have a Web project called WebProject, you should consider creating a type WEBPRJ1, which will be used to store all the source of this particular project.

Note: Currently the system does not support storing multiple members with the same long name under one SCLM type in a project. This is precisely why it is recommended that you create a new type for every project. Commonly used files such as .project, .classpath, and web.xml are problematic if you share a type across multiple projects.

After you share your project, you need to add the project to SCLM. For information about this function, refer to theAdd to SCLM topic.

Note: Archdef Name is an optional field. However, you must specify the name of ARCHDEF member, which lists all components of the migrating project in order to guide the build process. If the specified ARCHDEF member already exists in SCLM, then it will append all newly migrated members excluding the duplicate entries.

The table below lists all the members that are selected in the previous page of the wizard. It is very important you select the correct language type for all members that will be migrated. The table summarizes the language type recommended when you are storing members in SCLM.

Source type Language type Description
Java™ source JAVA Java source whose name will be translated into short name and the contents will be converted into EBCDIC.
Java source JAVABIN Java source whose name will be translated into short name but their contents will not be translated into EBCDIC (remains in ASCII).
Others J2EEPART All other text files. Their names will be translated into short names and the contents will be translated into EBCDIC
Others J2EEBIN These member names will be translated into short names. These files are treated as binary files so that their contents will not be modified when stored in SCLM.

2. Project build

This step builds all components belonging to a particular J2EE project and creates an archived object such as WAR files for Web projects and JAR files for EJB projects. All components of a J2EE project must be included in an ARCHDEF file which is described in step 1.

To build your project using an existing J2EE ARCHDEF, select Team -> Archdef build.

This brings up the Archdef Build Options dialog. In this dialog, Archdef Name, Archdef type are mandatory fields. These fields should be used to uniquely specify a J2EE Archdef to be used to build your J2EE project. You can click the browse button next to the Archdef Name field to interactively select an Archdef.

The Build at Group field specifies where the members included in the ARCHDEF will be looked up in the SCLM hierarchy and used in the build process. For example, if you select TEST, the build process uses the first occurrence of the members in the SCLM hierarchy starting from the TEST level. The resulting classes, and generated objects , and build map will reside at the build at group.

If you do not have a J2EE build script associated with your ARCHDEF, you can generate the script for your J2EE project. To generate a script, select your J2EE project and select Generate Build Script. This brings up the Build Script Generation dialog.

On this dialog, you need to select the type of build script to generate. You can select one of the following: Java Project, Web Project , EJB Project and EAR project. The type selected should correspond to the type of project you are trying to build.

Build Script Name
Name used to store the new script in SCLM. The name of the script must follow the naming convention of the members in SCLM.
Note: If the member with the specified name already exists in SCLM, this will overwrite the contents of the specified member.
Project Name
Name used in the generated script to refer to this build process (that is, Ant project name). It should typically describe the purpose of the project (for example, MyWebProjectBuildScript).
JAR/WAR/EAR/SQLj Name
Long name used to store the archive object as the result of this build process. If you are building a Java project, it should have an extension of .jar. If you are building a Web project, it should have an extension of .war. If you are building an EJB project, it should not have any extension. The .jar extension is automatically appended to the name specified in this field.
Archdef Name
Name of the ARCHDEF that contains all components of your J2EE project. The ARCHDEF selected must have the language type of ARCHDEF and stored in the type of ARCHDEF in SCLM.
Build Mode
Indicates whether this project should be built in forced or conditional mode. The default is conditional.
Review Generated Script
This option lets you review and modify the contents of the generated script before adding to SCLM.

Using this approach, the generated script will have the language type of J2EEANT and stored under the type of J2EEBLD.

The following table summarizes where the results of various project builds are stored in SCLM.

Project type SCLM type
Java project J2EEJAR
Web project J2EEWAR
EJB project J2EEJAR
EAR project J2EEEAR

The Review generated script option gives you a final opportunity to review and modify the contents of the generated script before adding to SCLM.

3. Project deployment

For detailed information about project deployment, refer to Deployment services.


Feedback