1. ORACLE FUSION MIDDLEWARE
CONTINUOUS INTEGRATION
ENTERPRISE DEPLOYMENT
Version 1.0 Draft
24 Jan 2013
Prepared By – Rakesh B Gujjarlapudi
Rakesh_gujj@yahoo.com
Copyright 2013, Rakesh Gujjarlapudi. All rights reserved. Page 1
3. 1. INTRODUCTION
This document describes in detail the Continuous Integration practice against SOA artifacts.
Following components were installed and configured
Hudson 3.0.0 a continuous integration deployed on Oracle Web Logic Server 10.3.6.
Apache-maven-3.0.4 a software project management and comprehension tool which is based on the concept of
a project object model (POM). Maven will be used to manage project's build, reporting and documentation from
a central piece of information.
Subversion-1.7.8 a source code repository
1.1 Continuous Integration
Continuous Integration (CI) is a software engineering practice which attempts to improve quality and reduce time to
deliver software by applying small, frequent quality control efforts. It is characterized by these key practices:
Use of a version control system
All developers commit to the ‘HEAD’ (main code line) every day
The product is built on every commit
The build must be automated and fast
Automated deployment to a production-like environment
Automated testing
Results of all builds are published (so everyone can see who broke the build)
Deliverables are easily available (for developers, testers, other stakeholders)
Focus of CI will be around the use of Hudson, Maven and Subversion.
Continuous Integration for Oracle Fusion Middleware
Copyright 2013, Rakesh Gujjarlapudi. All rights reserved. Page 3
4. 1.2 Overview of the document
1. Install and Configure Hudson.
2. Install and Configure Maven.
3. Install/Configure Subversion.
4. Use the sample SOA Project in JDeveloper 11.1.16(SOA Composite Editor and Subversion plugin)
Create a Maven POM (pom.xml) so that Maven (and therefore Hudson) knows how to build the composite
project.
5. Check in SOA Project from JDeveloper into source code control system (Subversion)
6. Create a Hudson Job.
7. Hudson Job (Maven Job) will automatically compile, package and deploy to SOA server. If anything goes wrong,
an email is generated which lets us know what happened.
SCA builds are performed using a set of ANT build files and tasks
8. Maven will run the ANT jobs that are included with Oracle SOA Suite 11g.
9. Hudson will monitor the Subversion repository and when it sees a change, it will perform a build (compile,
package and deploy the composite).
10. All of the server components running on Oracle Linux 5.5, everything is 64-bit.
Subversion Details
http://pwesoa-svn:8080/svn/repos/
User name – pwesvnadmin
Password – d0sage
Hudson Details
WebLogic Server – 10.3.6
User name – Weblogic
Password - hudsonadmin1
http://pwesoa-svn:25001/console
http://pwesoa-svn:25003/hudson-3.0.0/
Copyright 2013, Rakesh Gujjarlapudi. All rights reserved. Page 4
6. 3. CONFIGURE HUDSON
Configure JDK
Configure ANT
Configure Maven
Configure Email Address
Click Save
Install Maven 3 and Subversion Plugins and restart the WebLogic Server on which Hudson is deployed
Copyright 2013, Rakesh Gujjarlapudi. All rights reserved. Page 6
9. 4. INSTALL MAVEN - APACHE-MAVEN-3.0.4
Download Maven http://maven.apache.org/download.cgi
Software Location - /u02/svn
Software File - /u02/svn/apache-maven-3.0.4-bin.tar.gz
Software Folder - /u02/svn/apache-maven-3.0.4
[aoracle@soadev03]$ cd /u02/svn/
[aoracle@soadev03]$ tar zxvf apache-maven-3.0.4-bin.tar.gz
Set Maven Home
[aoracle@soadev03]$ export M2_HOME=/u02/svn/apache-maven-3.0.4
Set Java Home
[aoracle@soadev03]$ export JAVA_HOME=/u02/oracle/jdk1.6.0_34/bin
Set Path
[aoracle@soadev03]$ export PATH=$PATH:$M2_HOME/bin
Check Maven Version for validity
[aoracle@soadev03 lib]$ mvn --version
Apache Maven 3.0.4 (r1232337; 2012-01-17 02:44:56-0600)
Maven home: /u02/svn/apache-maven-3.0.4
Java version: 1.6.0_34, vendor: Sun Microsystems Inc.
Java home: /u02/oracle/jdk1.6.0_34/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.18-238.5.1.0.1.el5", arch: "i386", family: "unix"
5. CONFIGURE MAVEN - APACHE-MAVEN-3.0.4
Setup Maven Plugin
[aoracle@soadev03]$ cd <WL_HOME>/wlserver/server/lib
[aoracle@soadev03]$ java -jar wljarbuilder.jar -profile weblogic-maven-plugin
Extract the Maven pom.xml from weblogic-maven-plugin.jar META-INF/maven/com.oracle.weblogic/weblogic-maven-
plugin/pom.xml and place it in <WL_HOME>/wlserver/server/lib
[aoracle@soadev03]$ mvn install:install-file -Dfile=weblogic-maven-plugin.jar -DpomFile=pom.xml
The plugin will now be available for use. We can execute the ‘help’ goal to test it:
[aoracle@soadev03]$ mvn com.oracle.weblogic:weblogic-maven-plugin:help
Copyright 2013, Rakesh Gujjarlapudi. All rights reserved. Page 9
10. 6. INSTALLING SUBVERSION
6.1 Install Apache Portable Runtime - APR-1.4.6
The Apache Portable Runtime (APR) is a supporting library for the Apache web server. It provides a set of application
programming interfaces (APIs) that map to the underlying Operating System (OS). Where the OS doesn't support a
particular function, APR will provide emulation. Thus programmers can use the APR to make a program portable across
different platforms.
Software Location - /u02/svn
Software File - /u02/svn/apr-1.4.6.tar.bz2
Software Folder - /u02/svn/apr-1.4.6
[aoracle@soadev03]$ cd /u02/svn/
[aoracle@soadev03]$ tar –xjf apr-1.4.6.tar.bz2
[aoracle@soadev03]$ cd /u02/svn/apr-1.4.6
[aoracle@soadev03]$ ./configure --prefix=/u02/svn/apr --disable-static --with-installbuilddir=/u02/svn/apr/share/apr-
1/build
[aoracle@soadev03]$ make
[aoracle@soadev03]$ make install
APR is now installed in /u02/svn/apr
Command Execution
--disable-static: This stops it from compiling a static version of libapr-1.
Contents
Installed Components
Installed Program:apr-1-config
Installed Library:libapr-1.so
Installed Directories/u02/svn/apr and /u02/svn/apr share/apr-1/build
Short Description
apr-1-config Is a shell script used to retrieve information about the apr library in the system. It is typically used
to compile and link against the library.
libapr-1.so is the Apache Portable Runtime library.
Package Information
Download (HTTP): http://archive.apache.org/dist/apr/apr-1.4.6.tar.bz2
Copyright 2013, Rakesh Gujjarlapudi. All rights reserved. Page 10
11. 6.2 Install Expat - expat-2.1.0
The Expat package contains a stream oriented C library for parsing XML
Software Location - /u02/svn
Software File - /u02/svn/expat-2.1.0.tar.gz
Software Folder - /u02/svn/expat-2.1.0
[aoracle@soadev03]$ cd /u02/svn/
[aoracle@soadev03]$ tar zxvf expat-2.1.0.tar.gz
[aoracle@soadev03]$ cd /u02/svn/expat-2.1.0
[aoracle@soadev03]$ ./configure --prefix=/u02/svn/expat
[aoracle@soadev03]$ make
[aoracle@soadev03]$ make install
EXPAT is now installed in /u02/svn/expat
Command Execution
--disable-static: This stops it from compiling a static version of libapr-1.
Contents
Installed Program:xmlwf
Installed Library:libexpat.{so,a}
Installed Directory: /u02/svn/expat
Short Description
xmlwf is a non-validating utility to check whether or not XML documents are well formed.
libexpat.{so,a} contains API functions for parsing XML.
Package Information
Download (HTTP): http://downloads.sourceforge.net/expat/expat-2.1.0.tar.gz
Copyright 2013, Rakesh Gujjarlapudi. All rights reserved. Page 11
12. 6.3 Install Oracle Berkeley DB – 5.3.21
The Oracle Berkeley DB family of open source, embeddable databases provides developers with fast, reliable, local
persistence with zero administration.
Software Location - /u02/svn
Software File - /u02/svn/db-5.3.21.tar.gz
Software Folder - /u02/svn/db-5.3.21
[aoracle@soadev03]$ cd /u02/svn/
[aoracle@soadev03]$ tar zxvf db-5.3.21.tar.gz
[aoracle@soadev03]$ cd /u02/svn/ db-5.3.21
[aoracle@soadev03]$ cd build_unix
[aoracle@soadev03]$ ../dist/configure --prefix=/u02/svn/berkeley --enable-compat185 --enable-dbm --disable-static --
enable-cxx
[aoracle@soadev03]$ make
[aoracle@soadev03]$ make install
Berkeley is now installed in /u02/svn/ berkeley
Command Execution
cd build_unix && ../dist/configure --prefix=/u02...: This replaces the normal ./configure command, as Berkeley DB comes
with various build directories for different platforms.
--enable-compat185: This switch enables building the DB-1.85 compatibility API.
--enable-cxx: This switch enables building C++ API libraries.
--enable-dbm: Enables legacy interface support needed by some older packages.
Contents
Installed Programs:db_archive, db_checkpoint, db_deadlock, db_dump, db_hotbackup, db_load, db_log_verify,
db_printlog, db_recover, db_replicate, db_stat, db_tuner, db_upgrade and db_verify.
Installed Libraries:libdb.so and libdb_cxx.so
Installed Directory:/usr/share/doc/db-5.3.21
Short Description
db_archive prints the pathnames of log files that are no longer in use.
db_checkpoint is a daemon process used to monitor and checkpoint database logs.
db_deadlock is used to abort lock requests when deadlocks are detected.
db_dump converts database files to a flat file format readable by db_load.
db_hotbackup creates "hot backup" or "hot failover" snapshots of Berkeley DB databases.
db_load is used to create database files from flat files created with db_dump.
db_log_verify verifies the log files of a database.
db_printlog converts database log files to human readable text.
db_recover is used to restore a database to a consistent state after a failure.
db_replicate is a daemon process that provides replication/HA services on a transactional environment.
Copyright 2013, Rakesh Gujjarlapudi. All rights reserved. Page 12
13. db_stat displays database environment statistics.
db_tuner analyzes the data in a btree database, and suggests a page size that is likely to deliver optimal operation.
db_upgrade is used to upgrade database files to a newer version of Berkeley DB.
db_verify is used to run consistency checks on database files
Package Information
Download (HTTP): http://oracle.com
6.4 Install ZLIB - zlib-1.2.7
Software Location - /u02/svn
Software File - /u02/svn/zlib-1.2.7.tar.gz
Software Folder - /u02/svn/zlib-1.2.7
[aoracle@soadev03]$ cd /u02/svn/zlib-1.2.7
[aoracle@soadev03]$ tar zxvf zlib-1.2.7.tar.gz
[aoracle@soadev03]$ cd /u02/svn/zlib-1.2.7
[aoracle@soadev03]$ ./configure --prefix=/u02/svn/zlib
[aoracle@soadev03]$ make
[aoracle@soadev03]$ make install
ZLIB is now installed in /u02/svn/zlib
Copyright 2013, Rakesh Gujjarlapudi. All rights reserved. Page 13
14. 6.5 Install OpenSSL-1.0.1c
The OpenSSL package contains management tools and libraries relating to cryptography. These are useful for providing
cryptography functions to other packages, such as OpenSSH, email applications and web browsers (for accessing HTTPS
sites).
Additional Downloads
Required patch: http://www.linuxfromscratch.org/patches/blfs/svn/openssl-1.0.1c-fix_manpages-1.patch
Software Location - /u02/svn
Software File - /u02/svn/openssl-1.0.1c.tar.gz
Software Folder - /u02/svn/openssl-1.0.1c
Patch Location Software Folder - /u02/svn/openssl-1.0.1c-fix_manpages-1.patch
[aoracle@soadev03]$ cd /u02/svn/
[aoracle@soadev03]$ tar zxvf openssl-1.0.1c.tar.gz
[aoracle@soadev03]$ cd /u02/svn/ openssl-1.0.1c
[aoracle@soadev03]$patch -Np1 -i ../openssl-1.0.1c-fix_manpages-1.patch &&
[aoracle@soadev03]$./config --prefix=/u02/svn/openssl zlib-dynamic --openssldir=/u02/svn/openssl shared &&
[aoracle@soadev03]$ make
[aoracle@soadev03]$ make install
OPEN SSL is now installed in /u02/svn/openssl
Config Files
/u02/svn/openssl/ssl/openssl.cnf
Command Execution
shared: This parameter forces the creation of shared libraries along with the static libraries.
zlib-dynamic: This parameter adds compression/decompression functionality using the libz library.
Contents
Installed Programs:c_rehash and openssl.
Installed Libraries:libcrypto.{so,a}, libssl.{so,a}, and additional encryption libraries in /usr/lib/engines/ (lib4758cca.so,
libaep.so, libatalla.so, libcapi.so, libchil.so, libcswift.so, libgmp.so, libgost.so, libnuron.so, libpadlock.so, libsureware.so,
and libubsec.so).
Short Description
c_rehash is a Perl script that scans all files in a directory and adds symbolic links to their hash values.
Openssl is a command-line tool for using the various cryptography functions of OpenSSL's crypto library from the shell. It
can be used for various functions which are documented in man 1 openssl.
libcrypto.{so,a} implements a wide range of cryptographic algorithms used in various Internet standards.
libssl.{so,a} implements the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols.
Package Information
Download (HTTP): http://www.openssl.org/source/openssl-1.0.1c.tar.gz
Copyright 2013, Rakesh Gujjarlapudi. All rights reserved. Page 14
15. 6.6 Install PCRE - pcre-8.30
Software Location - /u02/svn
Software File - /u02/svn/ pcre-8.30.tar.gz
Software Folder - /u02/svn/ pcre-8.30
[aoracle@soadev03]$ cd /u02/svn/
[aoracle@soadev03]$ tar zxvf pcre-8.30.tar.gz
[aoracle@soadev03]$ cd /u02/svn/ pcre-8.30
[aoracle@soadev03]$ ./configure --prefix=/u02/svn/pcre
[aoracle@soadev03]$ make
[aoracle@soadev03]$ make install
PCRE is now installed in /u02/svn/expat
6.7 Install SQLITE - sqlite-autoconf-3071502.tar.gz
Software Location - /u02/svn
Software File - /u02/svn/sqlite-autoconf-3071502.tar.gz
Software Folder - /u02/svn/sqlite-autoconf-3071502
[aoracle@soadev03]$ cd /u02/svn/
[aoracle@soadev03]$ tar zxvf sqlite-autoconf-3071502.tar.gz
[aoracle@soadev03]$ cd /u02/svn/sqlite-autoconf-3071502
[aoracle@soadev03]$ ./configure --prefix=/u02/svn/sqlite
[aoracle@soadev03]$ make
[aoracle@soadev03]$ make install
SQLITE is now installed in /u02/svn/sqlite
6.8 Install NEON - neon-0.29.6.tar.gz
Software Location - /u02/svn
Software File - /u02/svn/ neon-0.29.6.tar.gz
Software Folder - /u02/svn/ neon-0.29.6
[aoracle@soadev03]$ cd /u02/svn/
[aoracle@soadev03]$ tar zxvf neon-0.29.6.tar.gz
[aoracle@soadev03]$ cd /u02/svn/ neon-0.29.6
[aoracle@soadev03]$ ./configure --prefix=/u02/svn/neon
[aoracle@soadev03]$ make
[aoracle@soadev03]$ make install
NEON is now installed in /u02/svn/neon
Copyright 2013, Rakesh Gujjarlapudi. All rights reserved. Page 15
16. 6.9 Install Apache Web Server 2.4.3
Software Location - /u02/svn/
Software File - /u02/svn/ httpd-2.4.3.tar.gz
Software Folder - /u02/svn/ httpd-2.4.3
[aoracle@soadev03]$ cd /u02/svn/
[aoracle@soadev03]$ tar zxvf httpd-2.4.3.tar.gz
[aoracle@soadev03]$ cd /u02/svn/ httpd-2.4.3.tar.gz
[aoracle@soadev03]$ export LD_LIBRARY_PATH=/u02/svn/berkeley/lib
[aoracle@soadev03]$ ./configure --prefix=/u02/svn/apache
[aoracle@soadev03]$ make
[aoracle@soadev03]$ make install
[aoracle@soadev02 bin]$ cd /u02/svn/apache/bin
[aoracle@soadev02 bin]$ apachectl -f /u02/svn/apache/conf/httpd.conf -t
Syntax OK
[aoracle@soadev02 bin]$ ./apachectl -f /u01/Apache/apache2.2/conf/httpd.conf -k start
Copyright 2013, Rakesh Gujjarlapudi. All rights reserved. Page 16
17. 6.10 Install APR-UTIL – 1.5.1
The Apache Portable Runtime Utility Library provides a predictable and consistent interface to underlying client library
interfaces. This application programming interface assures predictable if not identical behavior regardless of which
libraries are available on a given platform.
Software Location - /u02/svn
Software File - /u02/svn/apr-util-1.5.1.tar.bz2
Software Folder - /u02/svn/apr-util-1.5.1
[aoracle@soadev03]$ cd /u02/svn/
[aoracle@soadev03]$ tar –xjf expat-2.1.0.tar.gz
[aoracle@soadev03]$ cd /u02/svn/ apr-util-1.5.1
[aoracle@soadev03]$ export LD_LIBRARY_PATH=/u02/svn/berkeley/lib
[aoracle@soadev03]$ ./configure --prefix=/u02/svn/apr-util --with-apr=/u02/svn/apr --with-gdbm=/u02/svn --with-
berkeley-db=/u02/svn/berkeley/include:/u02/svn/berkeley/lib --with-openssl=/u02/svn/openssl
[aoracle@soadev03]$ make
[aoracle@soadev03]$ make install
APR-UTIL is now installed in /u02/svn/apr-util
Command Execution
--with-gdbm=/u02/svn: This option makes it compile the apr_dbm_gdbm-1.so plugin.
--with-berkeley-db=/usr: If you have installed Berkeley DB-5.3.21 use this option to compile the apr_dbm_db-1.so
plugin.
--with-openssl=/u02/svn/openssl and --with-crypto: If you have installed OpenSSL-1.0.1c, use these options to compile
the apr_crypto_openssl-1.so plugin.
Contents
Installed Program:apu-1-config
Installed Library:libaprutil-1.so
Installed Directory:/usr/lib/apr-util-1
Short Description
apu-1-config is a simple script that provides information about the installed APR-Util program.
libaprutil-1.so contains functions that provide a predictable and consistent interface to underlying client library
interfaces.
Package Information
Download (HTTP): http://archive.apache.org/dist/apr/apr-util-1.5.1.tar.bz2
Copyright 2013, Rakesh Gujjarlapudi. All rights reserved. Page 17
18. 6.11 Install SUBVERSION subversion-1.7.8.tar.gz
Subversion is a version control system that is designed to be a compelling replacement for CVS in the open source
community.
Software Location - /u02/svn
Software File - /u02/svn/ subversion-1.7.8.tar.gz
Software Folder - /u02/svn/ subversion-1.7.8
[aoracle@soadev03]$ cd /u02/svn/
[aoracle@soadev03]$ tar zxvf subversion-1.7.8.tar.gz
[aoracle@soadev03]$ cd /u02/svn/subversion-1.7.8
[aoracle@soadev03]$ export LD_LIBRARY_PATH=/u02/svn/berkeley/lib
[aoracle@soadev03]$ ./configure --prefix=/u02/svn/subversion --with-apxs=/u02/svn/apache/bin/apxs --with-
apr=/u02/svn/apr --with-apr-util=/u02/svn/apr-util --with-zlib=/u02/svn/zlib --with-neon=/u02/svn/neon
[aoracle@soadev03]$ make
[aoracle@soadev03]$ make install
SUBVERSION is now installed in /u02/svn/subversion
Command Execution
--disable-static: This stops it installing static versions of the libraries.
Contents
Installed Programs:svn, svnadmin, svndumpfilter, svnlook, svnserve, svnsync and svnversion
Installed Libraries:libsvn*.so and optionally, a Java library, the mod_dav_svn.so, and mod_authz_svn.so Apache HTTP
DSO modules and various Perl and Python modules.
Short Description
svn is a command-line client program used to access Subversion repositories.
svnadmin is a tool for creating, tweaking or repairing a Subversion repository.
svndumpfilter is a program for filtering Subversion repository dumpfile format streams.
Svnlook is a tool for inspecting a Subversion repository.
svnrdump is a tool for dumping or loading a remote Subversion repository.
Svnserve is a custom standalone server program, able to run as a daemon process or invoked by SSH.
Svnsync is a Subversion repository synchronisation tool.
Svnversion is used to report the version number and state of a working Subversion repository copy.
libsvn_*.so are the support libraries used by the Subversion programs.
mod_authz_svn.so is a plug-in module for the Apache HTTP server, used to authenticate users to a Subversion
repository over the Internet or an intranet.
mod_dav_svn.so is a plug-in module for the Apache HTTP server, used to make a Subversion repository available
to others over the Internet or an intranet.
Package Information
Download (HTTP): http://archive.apache.org/dist/subversion/subversion-1.7.8.tar.bz
Copyright 2013, Rakesh Gujjarlapudi. All rights reserved. Page 18
19. 6.12 Subversion Configuration
Add this in /u02/svn/apache/conf/httpd.conf file
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
Make sure you will add these lines after LoadModule dav_module modules/mod_dav.so
Create one repository with svnadmin command. Run this command inside your subversion folder.
svnadmin create repos
ls repos
conf dav db format hooks locks README.txt
This full path you have to specify in SVNPath.
Then at the end of the httpd.conf file you have to add
#for svn path
<Location /svn/repos>
DAV svn
SVNPath /u02/svn/subversion/repos
</Location>
now restart apache
For security purpose to give authentication to the user we have to create authentication file with the command,
[aoracle@soadev03 bin]$ htpasswd -cm /u02/svn/subversion/svn-auth-file pwesvnadmin
New password:
Re-type new password:
Adding password for user pwesvnadmin
And to specify which access you want to give the user, create svn-access-file inside /etc.
Inside this file add code as,
[/]
* = rw
This will give authentication to every user specified in Require user inside location.
You can specify this inside httpd.conf file as,
Copyright 2013, Rakesh Gujjarlapudi. All rights reserved. Page 19
20. <Location /svn/repos>
DAV svn
SVNPath /u02/svn/subversion/repos
AuthzSVNAccessFile /u02/svn/subversion/svn-access-file
AuthType Basic
AuthName “Subversion repository”
AuthUserFile /u02/svn/subversion/svn-auth-file
Require user user_name
</Location>
Subversion URL
http://pwesoa-svn:8080/svn/repos/
User name – pwesvnadmin
Password – d0sage
Copyright 2013, Rakesh Gujjarlapudi. All rights reserved. Page 20
21. 7. SUBVERSION CONFIGURATION FOR JDEVELOPER 11.1.1.6
Copyright 2013, Rakesh Gujjarlapudi. All rights reserved. Page 21
22. 8. CHECK INTO SUBVERSION FROM JDEVELOPER
Select Version Project
Select Subversion
Copyright 2013, Rakesh Gujjarlapudi. All rights reserved. Page 22
23. Welcome screen
Select Destination
Copyright 2013, Rakesh Gujjarlapudi. All rights reserved. Page 23
25. 9. MAVEN POM.XML FOR SOA PROJECT
In JDeveloper,
Create an Application to hold Project(s). There can be one or more projects in an application. Within the project, we are
going to create a Maven POM so that Maven (and therefore Hudson) knows how to build our composite project.
Look at the ANT jobs we will use. These are found in the SOA Suite installation under the Oracle_SOA1/bin directory:
Scripts to compile, package and deploy our project.
ant-sca-compile.xml Compiles a composite project
ant-sca-package.xml Packages a composite project (into a SAR)
ant-sca-deploy.xml Deploys a composite project (a SAR)
Each script needs some variables/properties/arguments to tell it what to do:
ant-sca-compile.xml, target: scac
scac.input: The location of the composite.xml
ant-sca-package.xml, target: package
compositeName: The name of the composite (will show up in EM)
compositeDir: The directory containing the composite
revision: The version number for the composite
ant-sca-deploy.xml, target: deploy
serverURL: The URL of the SOA instance
user: The user to do the deployment
password: The deploying user's password
sarLocation: The location of the SAR file
overwrite: Overwrite existing deployments with same revision?
forceDefault: Make this version the default version?
partition: Which SOA partition to deploy into
Copyright 2013, Rakesh Gujjarlapudi. All rights reserved. Page 25
26. 9.1 POM.xml
pom.xml will be added into the project. It will be in the same place where the composite.xml is located.
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- Group ID is the Application Name -->
<groupId>SOASuiteSamples</groupId>
<!-- Artificat ID is the Project Name -->
<artifactId>HelloWorld</artifactId>
<version>1.0-SNAPSHOT</version>
<scm>
<connection>scm:svn:svn://pwesvnadmin@pwesoa-svn/svn/repos/pweSOA/SOASuiteSamples/HelloWorld</connection>
<developerConnection>scm:svn:svn://pwesvnadmin@pwesoa-svn/svn/repos/pweSOA/SOASuiteSamples/HelloWorld</developerConnection>
</scm>
<dependencies>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>sca-compile</id>
<phase>compile</phase>
<configuration>
<target>
<property name="scac.input" value="${basedir}/composite.xml" />
<ant antfile="/u02/oracle/Middleware/Oracle_SOA1/bin/ant-sca-compile.xml"
dir="/u02/oracle/Middleware/Oracle_SOA1/bin"
target="scac" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>sca-package</id>
<phase>package</phase>
<configuration>
<target>
<property name="build.compiler" value="extJavac"/>
<property name="compositeName" value="${project.artifactId}" />
<property name="compositeDir" value="${basedir}" />
<property name="revision" value="${project.version}" />
<ant antfile="/u02/oracle/Middleware/Oracle_SOA1/bin/ant-sca-package.xml"
dir="/u02/oracle/Middleware/Oracle_SOA1/bin"
target="package" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
Copyright 2013, Rakesh Gujjarlapudi. All rights reserved. Page 26
27. <execution>
<id>sca-deploy</id>
<phase>deploy</phase>
<configuration>
<target>
<property name="serverURL" value="http://pwesoa1v:7001" />
<property name="user" value="weblogic" />
<property name="password" value="weblogic1" />
<property name="sarLocation" value="${basedir}/deploy/sca_${project.artifactId}_rev${project.version}.jar" />
<property name="overwrite" value="true" />
<property name="forceDefault" value="true" />
<property name="partition" value="default" />
<ant antfile="/u02/oracle/Middleware/Oracle_SOA1/bin/ant-sca-deploy.xml"
dir="/u02/oracle/Middleware/Oracle_SOA1/bin"
target="deploy" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<distributionManagement>
<!-- use the following if you're not using a snapshot version. -->
<repository>
<id>local</id>
<name>local repository</name>
<url>file:///home/aoracle/.m2/repository</url>
</repository>
<!-- use the following if you ARE using a snapshot version. -->
<snapshotRepository>
<id>localSnapshot</id>
<name>local snapshot repository</name>
<url>file:///home/aoracle/.m2/repository</url>
</snapshotRepository>
</distributionManagement>
</project>
First section is the Maven coordinates that will identify this project.
groupId the name of your application
artifactId the name of your project.
<groupId>soaProject2</groupId>
<artifactId>soaProject2</artifactId>
<version>1.0-SNAPSHOT</version>
Second section indicates details for our Subversion server.
Maven will use the details here in the POM if we want to do a ‘release’ in Maven. The distributionManagement section
(see above) is also provided for this purpose and so that Maven can archive our builds during deployment.
<scm>
<connection>scm:svn:svn+ssh://mark@ofm1.au.oracle.com/home/mark/svnrepos/soaProject2/trunk</connection>
<developerConnection>scm:svn:svn+ssh://mark@ofm1.au.oracle.com/home/mark/svnrepos/soaProject2/trunk</developerConnection>
</scm>
maven-antrun-plugin to execute the ANT tasks.
Copyright 2013, Rakesh Gujjarlapudi. All rights reserved. Page 27
28. You can see the configuration in the complete POM above. We will include the three separate ANT jobs (compile,
package and deploy) in three phases of our Maven build. Basically, we create an execution, give it an id, assign it to a
phase, and then we add inside the target section our property‘s and then run the ant task giving it the antfile, a directory
to run in, and a target to run. Here is the relevant section for the compile:
<execution>
<id>sca-compile</id>
<phase>compile</phase>
<configuration>
<target>
<property name="scac.input" value="${basedir}/composite.xml" />
<ant antfile="/home/mark/Oracle/Middleware/Oracle_SOA1/bin/ant-sca-compile.xml"
dir="/home/mark/Oracle/Middleware/Oracle_SOA1/bin"
target="scac" />
</target>
You can see the full POM above. One little trick to be aware of is that we need to add an extra property to the package
phase to make sure it uses the external JDK. If you don’t include this property, you will most likely get an error telling
you ANT cannot find javac because it is pointing to a JRE, not a JDK.
<property name="build.compiler" value="extJavac"/>
Copyright 2013, Rakesh Gujjarlapudi. All rights reserved. Page 28
29. 10. MAVEN POM.XML FOR SOA PROJECT (MDS DEPENDENT)
MDS Location in Descriptors -> ADF META-INF -> adf-config.xml
<?xml version="1.0" encoding="windows-1252" ?>
<adf-config xmlns="http://xmlns.oracle.com/adf/config"
xmlns:config="http://xmlns.oracle.com/bc4j/configuration"
xmlns:adf="http://xmlns.oracle.com/adf/config/properties"
xmlns:sec="http://xmlns.oracle.com/adf/security/config">
<adf-adfm-config xmlns="http://xmlns.oracle.com/adfm/config">
<defaults useBindVarsForViewCriteriaLiterals="true"/>
<startup>
<amconfig-overrides>
<config:Database jbo.locking.mode="optimistic"/>
</amconfig-overrides>
</startup>
</adf-adfm-config>
<adf:adf-properties-child xmlns="http://xmlns.oracle.com/adf/config/properties">
<adf-property name="adfAppUID" value="SOASuiteSamples-4658"/>
</adf:adf-properties-child>
<sec:adf-security-child xmlns="http://xmlns.oracle.com/adf/security/config">
<CredentialStoreContext credentialStoreClass="oracle.adf.share.security.providers.jps.CSFCredentialStore"
credentialStoreLocation="../../src/META-INF/jps-config.xml"/>
</sec:adf-security-child>
<adf-mds-config xmlns="http://xmlns.oracle.com/adf/mds/config">
<mds-config xmlns="http://xmlns.oracle.com/mds/config">
<persistence-config>
<metadata-namespaces>
<namespace metadata-store-usage="mstore-usage_1" path="/soa/shared"/>
</metadata-namespaces>
<metadata-store-usages>
<metadata-store-usage id="mstore-usage_1">
Replace File Based with DB Based MDS
<metadata-store class-name="oracle.mds.persistence.stores.file.FileMetadataStore">
<property value="${oracle.home}/integration"
name="metadata-path"/>
<property value="seed" name="partition-name"/>
</metadata-store>
<metadata-store class-name="oracle.mds.persistence.stores.db.DBMetadataStore">
<property name="jdbc-userid" value="R6DEV_MDS"/>
<property name="jdbc-password" value="c0aster"/>
<property name="jdbc-url"
value="jdbc:oracle:thin:@10.20.129.134:1521:SOAREP"/>
<property name="partition-name" value="soa-infra"/>
</metadata-store>
</metadata-store-usage>
</metadata-store-usages>
</persistence-config>
</mds-config>
</adf-mds-config>
</adf-config>
Include base directory in pom.xml in compile and package section
<property name="scac.application.home" value="${basedir}/.." />
Setting the scac.application.home is required when you use MDS-dependent components, as the build tasks will look for
a configuration file called {scac.application.home}/.adf/adf-config.xml in order to find out where your MDS is located. If
you do not set this parameter, the (ANT) build tasks will not be able to find your MDS and the build will fail
Copyright 2013, Rakesh Gujjarlapudi. All rights reserved. Page 29
30. 11. MAVEN POM.XML FOR SOA PROJECT (SCA TEST)
Create Test Cases for the composite and include the following lines in pom.xml
<execution>
<id>sca-test</id>
<phase>deploy</phase>
<configuration>
<target>
<property name="jndi.properties.input" value=" /u02/oracle/Middleware/sca-test.jndi.properties" />
<property name="scatest.input" value="SCATestSample" />
<property name="scatest.format" value="junit" />
<property name="scatest.result" value="reports" />
<ant antfile=" /u02/oracle/Middleware/Oracle_SOA1/bin/ant-sca-test.xml"
dir=" /u02/oracle/Middleware/Oracle_SOA1/bin"
target="test" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
jndi.properties
java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
java.naming.provider.url=t3://bpm.mark.oracle.com:7001/soa-infra
java.naming.security.principal=weblogic
java.naming.security.credentials=welcome1
dedicated.connection=true
dedicated.rmicontext=true
Create a NEW JOB in Hudson and select Build a free-style software project
In the Build section, click on the Add build step button and choose Invoke top-level Maven targets. Enter clean deploy
as your Goals and set the POM to pom.xml.
In the Post-build Actions section, check the option to Publish JUnit test result report and enter the location of reports (in
Your report XMLs) as reports/*.xml. This tells Hudson to look for XML files in the reports directory. Recall that we
configured this in our POM earlier.
Copyright 2013, Rakesh Gujjarlapudi. All rights reserved. Page 30
31. 12. CONTINUOUS INTEGRATION FOR OSB
Coming Soon…………..
Copyright 2013, Rakesh Gujjarlapudi. All rights reserved. Page 31
32. 13. Appendix
http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-antrun-plugin/
Plugin version 1.7
Copyright 2013, Rakesh Gujjarlapudi. All rights reserved. Page 32