IBM Support

Sterling buildEAR script modification, to include custom files in the EAR.

Troubleshooting


Problem

There might be a situation where you need to add some custom files into the EAR for your solution in an automated way and also prevent those files to be overridden at the time of upgrade or fix pack installation. In this particular example, the script below was modified to add more logic which handles custom file ibm-application-bnd.xmi and adds it to the EAR during build process. The file ibm-aplication-bnd.xmi carries the application bindings used by WebSphere Application Server. The functionality of this script is flexible in extending/changing the type of files or their location.

Resolving The Problem

Note that this solution was not tested under IBM QA policy and procedures, therefore it is provided on AS-IS basis. You are implementing this script at your own responsibility

The script buildear.sh and buildEAR.xml needs to be changed as described below.
Before you modify anything, please take a backup of those two files mentioned (buildear.sh and buildEAR.xml) in case you would need to restore the configuration to its out of the box condition.

First the logic:

  • all of the files required to build the EAR are being first copied and collected in the <INSTALL_DIR>\tmp folder. To prevent the files from being overridden by the FP installation or upgrade you need to create the fileset location, outside of Sterling directory, in this example C:\EAR_files
  • first we need to specify env variable, this is defined by:

<property environment="env"/>

  • the variable value can be passed on at the script or system level, in this case, it was defined at the script level as:

set CUSTOMER_FILESET=C:\EAR_files

  • the 'copy' task is added to move the file from C:\EAR_files to <INSTALL_DIR>\tmp\smcfs\META-INF - ANT knows that this folder is under smcfs folder so you don't need to set this exclusively, it looks like this:


<!-- in the task: <copy todir="${eartmp}/META-INF"> you can provide any other path if required, in this case this is default folder where WAS creates bindings file -->
<!-- in the attribute: includes="*.*"/> you can specify just *.xmi extension of files or all files ("*.*") -->

<copy todir="${eartmp}/META-INF">
<fileset dir="${env.CUSTOMER_FILESET}" includes="*.*"/>
</copy>

  • within <target name="-zip-ear">, you need to specify file types and location from which the files will be copied, we add here '**/*.xmi':

<fileset dir="${eartmp}" includes="*.war,*.jar,**/*.xmi" />
  • to prevent the script file and .xml file to be overridden, rename them based on your own name convention, in this case custom_buildear.sh and custom_buildEAR.xml. This also requires a change inside the custom_buildaer.sh script:


%JAVA% -classpath C:/Sterling/Foundation/jar/bootstrapper.jar -Dvendor=shell -DvendorFile=C:/Sterling/Foundation/properties/servers.properties %ANT_OPTS% com.sterlingcommerce.woodstock.noapp.NoAppLoader -p "%ANTJARS%" -class org.apache.tools.ant.Main -f %APP_DCL_FILE% -invokeargs -f C:/Sterling/Foundation/properties\custom_buildEAR.xml %* 2>&1 | C:\Sterling\Foundation\bin\tee %LOG_FILE%


Based on the logic above, here is the complete script:

[{"Product":{"code":"SS6PEW","label":"Sterling Order Management"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"--","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All","Edition":"All Editions","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Document Information

More support for:
Sterling Order Management

Software version:
All

Document number:
520953

Modified date:
16 June 2018

UID

swg21691827

Manage My Notification Subscriptions