Packaging custom Java EE assets

The packaging format for Java EE applications is clearly defined in the Java EE specification. Java EE applications are delivered as Java EE EAR files, which are JAR files that have special deployment descriptors to tell the application server information about the application.

Enterprise applications are divided into smaller parts:
  • EJB modules
  • WAR files
  • Logic or utilities
  • RAR or connector modules
Considerations for the struts-config-ext.xml file
If you edit the WebSphere Commerce Struts custom configuration file, struts-config-ext.xml, you must add it to your source code management system and package it along with other changed files. Since the store identifiers in your development environment, quality assurance environment, and production environment can be different, you will need to change this file during the packaging phase to change the store identifiers to match the target environment. After completing this, you can deploy your changes.

For more information about the struts-config-ext.xml file, see Customizing the Web application configuration and Updating the Web application configuration.

WebSphere Commerce assets and WebSphere Application Server deployment packages
When you deploy your custom assets, it is important that you understand and package your WebSphere Commerce assets in a format that is compatible with WebSphere Application Server. The following table outlines which WebSphere Application Server package type you should use, depending on the WebSphere Commerce assets and number of assets, that you want to deploy:
Notes:
  1. You can combine the packaging options; for example, if you have updates for EJB files and JSP files, you can build two deployment packages: an EJB module JAR file and a partial application ZIP file.
  2. WebSphere Application Server also provides an option to replace the entire EAR file with a new version; however, this option is not supported for WebSphere Commerce.
  3. All packaging options assume you are packaging from your WebSphere Commerce development environment.
Packaging method Description Explanation
Single file Any single WebSphere Commerce asset, for example:
  • Logic or Utility JAR file containing:
    • Controller commands
    • Data beans
    • Utility classes
  • Store assets:
    • JSP files
    • HTML files
    • Configuration XML files
    • Images
    • Properties files or resource bundles
Use this option if you only have updates for a single file in the application. The file must not be a module file such as an EJB module or Web module. The file can be inside any module of the application. For example, if you have changes to an XML file, use package as a single file.
Notes:
  1. If you are working with several single files, package and deploy the files as a partial application. A partial application deployment requires your application to be down and restarted only once, not once per file.
  2. A single file is any one file within the EAR during deployment. The single file can be a JAR file, which contains several command, data bean, or Java code changes. As long as these are packaged as a single JAR file for the EAR, then this is considered a single file deployment.
  3. If your single "file" is a WAR file, EJB module, or other module, you should not use this option; use the "Module file" instead.
Partial application More than one of the WebSphere Commerce assets described in the "Single file" option. Use this option if you want to update or delete several files in the application as defined in the single file method on the "Single file" option. The group of files do not have to be in the same module. You would typically use this option to update the follow types of files:
  • Configuration files (not Java EE deployment descriptors)
  • JSP files
  • Images
  • Utility JAR files
Notes:
  1. If you are working with several files, package and deploy as a partial application, as a partial application deployment requires your application to be down and restarted only once, not once per file.
  2. If you deploy as a partial application, WebSphere Application Server adds a file if it does not already exist in the application, updates a changed file if the file exists, or deletes a file if the file matches something in the ibm-partialapp-delete.props file.
Module file An entire module, typically an EJB module.

Use this option if you want to:
  • Add, update, or delete a new module in the application (Note that if you want to deploy more than one module, you must use this option multiple times)
  • Update an entire EJB module
  • Deploy the Management Center application (packaged as a WAR file)
  • Update changes to the deployment descriptors