In my ant script I will deploy shared artifacts to the MDS, compile, build and package the composite applications and deploy this to the SOA Server. After this I use an ANT script to start the unit tests and generate a JUnit result XML and at last I can optional disable the composite.
This JUnit XML can be used in your continuous build system. You can easily extend this build script so you use it to manage the composite applications.
For more info over ANT deployment see the official deployment documentation .
The official ANT scripts are located in the jdeveloper\bin folder. Here is a summary of the scripts and what they can do
- ant-sca-test.xml, This script can start the test suites of the composite and generates a juinit report and not Attaches, extracts, generates, and validates configuration plans for a SOA composite application, The official documentation description is not correct.
- ant-sca-compile.xml, Compiles a SOA composite application ,this script is also called in the package scrip, so we don't need to call this directly.
- ant-sca-package.xml, Packages a SOA composite application into a composite SAR file and also validates and build the composite application.
- ant-sca-deploy.xml, Deploys a SOA composite application.
- ant-sca-mgmt.xml, Manages a SOA composite application, including starting, stopping, activating, retiring, assigning a default revision version, and listing deployed SOA composite applications.
Here is the main build.properties where you have to define the jdeveloper and your application home, which composite applications you want to deploy and what is the environment dev or acc.
Every application can have one or more SOA projects so the main ant script will load the application properties file which contains all the project with its revision number.
Here is a example of SoaEjbReference.properties file
projects=Helloworld Helloworld.revision=1.0 Helloworld.enabled=true Helloworld.partition=default
Because in my example I have two soa environments so I need to create two configuration plans. With this plan ( which look the wls plan ) can change the url of endpoints so it matches with the environment.
Select the composite application xml and generate a configuration plan.
Add the dev or acc extension to the file name.
Here you see how the plan looks like.
And here is the main ANT build script which can do it all and calls the Oracle ANT scripts.
For development testing environment I need to have dev.jndi.properties
java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory java.naming.provider.url=t3://localhost:8001/soa-infra java.naming.security.principal=weblogic java.naming.security.credentials=weblogic1 dedicated.connection=true dedicated.rmicontext=true
And finally the CMD script to run this ANT script. To make this work we need the ant-contrib library and put this in the classpath of ANT or put it in the ANT lib folder.
set ORACLE_HOME=C:\oracle\MiddlewareJdev11gR1PS3 set ANT_HOME=%ORACLE_HOME%\jdeveloper\ant set PATH=%ANT_HOME%\bin;%PATH% set JAVA_HOME=%ORACLE_HOME%\jdk1.6.0_23 set CURRENT_FOLDER=%CD% ant -f build.xml deployAll
See my github project for the source code https://github.com/biemond/soa_tools
Latest changes.
- PS3 / PS4 support
- Activation of the composite
- partition support
- Build number generator
- Build logging
- SAR and MDS z ipsfiles are bundled under build number.
- Demo mode, in which you can test the ANT configuration without deploying
The new file structure with a logs and build folder.
The logging of a run.