Oracle SOA suite Packaging
In this post we will go through some basic steps to automate the daily tasks i.e. compilation and deployment of SOA projects.
In order to deploy the SOA projects on server we usually follow below two approaches:
1. Compile and Deploy using JDEV
2. Compile and Export the SAR using JDEV. Deploy using EM console.
The above is adopted in development phase. In testing and production we need to automate this deployment activities in order to avoid any human error. SOA suite provide us the ANT scripts to perform this tasks.
This same scripts are used by JDEV to perform the task like deploy/compile etc.
We will now go show the steps to use some basic commands:
I am using Oracle SOA 12c environment.
Pre-requisites:
Configure the ANT_HOME, JAVA_HOME and PATH variables.
1. ANT_HOME = (MIDDLEWARE_HOME)\Middleware\Oracle_Home\oracle_common\modules\org.apache.ant_1.9.2. PATH=%PATH%;(MIDDLEWARE_HOME)\Middleware\Oracle_Home\oracle_common\modules\org.apache.ant_1.9.2\bin
3. JAVA_HOME=C:\Program Files\Java\jdk1.7.0_71
The SOA build scripts files can be found under (Middlewarehome)\Middleware\Oracle_Home\soa\bin
1. Compiling the SOA project: ant-sca-compile.xml
This script is used to compile the SOA project. It takes composite.xml path and the output file path. This compilation output is written to output file in XML format.
ant -buildfile ant-sca-compile.xml -Dscac.input=C:\JDeveloper\mywork\SOA_Learning\Flow\SOA\composite.xml -Dscac.output=D:\tmp\SOA\compileoutput.txt
2. Generate .SAR file as .JAR: ant-sca-package.xml
This script is used to deploy the SOA project as .SAR called .JAR file.
ant -buildfile ant-sca-package.xml -DcompositeDir=C:\JDeveloper\mywork\SOA_Learning\Flow\SOA -DcompositeName=Flow -Drevision=1.2
3. Deploy to SOA Server: ant-sca-deploy.xml
This script is used to deploy the generated .JAR to SOA Server. We can set the configuration plan based on the environment on which we are deploying i.e. DEV/UAT/PROD
We can use the same script to perform following activities i.e. undeploy/ exportComposite/ exportUpdates/ importUpdates/ exportSharedData/ undeployRetiredComposites
ant -buildfile ant-sca-deploy.xml -DserverURL=http://localhost:7101 -DsarLocation=C:\JDeveloper\mywork\SOA_Learning\Flow\SOA\deploy\sca_Flow_rev1.1.jar -Doverwrite=true -Duser=weblogic -Dpassword=welcome1 -DforceDefault=true -DkeepInstancesOnRedeploy=false -DregenerateRuleBase=true -Dconfigplan=C:\JDeveloper\mywork\SOA_Learning\Flow\Flow_cfgplan.xml -DfailOnError=true
The above commands can be configured with Hudson to implement continuous integration.