Joine Music

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Tuesday, 24 November 2009

Hacking Oracle SOA Suite (11.1.1) builds to work with Ivy and Artifactory

Posted on 08:25 by Unknown

As discussed in a few previous posts, I’m on a mission to get my project’s SOA Suite builds to work without having to rely on a local installation of JDeveloper 11g with the added SOA Extension.

I’ve continued to make progress (with the help of Mayur – thanks) and we’ve now got compilation, packaging, deployment, and Unit Testing to work. We’ve still to tidy up our scripts so that they’re ready for publishing for public consumption, but in the meantime, I thought I’d put out some snippets which will help the enthusiastic to get to where we have.

Getting your Jar dependencies into Artifactory

My aim was to depend on Maven (and JFrog Artifactory) for our dependencies as much as possible. Where we could use publicly available Jars from the standard repositories we did. Sadly this turned out to be very infrequent. It did mean however that there was another reason to download and install Artifactory. This was very simple. We downloaded the Standalone version and ran it using the embedded Jetty. The only thing I needed to change from the default settings was to set a proxy (we’re behind a firewall.)

I then had to manually add all the Oracle dependencies which I had identified to ext-releases-local (Artifactory’s default Local repository for third party libraries). I had logged in as an Admin, and using the “Deploy” tab added them one at a time.

When I’d finished, it looked like this (apologies for the crappy screen grabs):

artifactory-structure-1 

artifactory-structure-2

artifactory-structure-6 artifactory-structure-3

artifactory-structure-4

 artifactory-structure-5

NOTE: It might be nice to bundle all these up as an artifacts bundle. I’ve not had the time to do this yet.

This meant we were now ready to link Ivy up to all of this.

Connecting Ivy and Artifactory

Next we had to tell Ivy to use either its local cache, or Artifactory, for all its dependency lookups. To do this, I created a new ivysettings.xml file with the following content:

<ivysettings>
    <settings defaultResolver="chain" />
    <resolvers>
        <chain name="chain" returnFirst="true">
            <filesystem name="local">
                <ivy pattern="C:/Documents and Settings/aharmel/.m2/repository/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
            </filesystem>
            <url name="shared">
                <artifact pattern="
http://build-xp-10:8081/artifactory/repo/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
            </url>
            <url name="public">
                <artifact pattern="
http://build-xp-10:8081/artifactory/repo/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
            </url>
        </chain>
    </resolvers>
</ivysettings>

This meant that when an ivy:resolve target was called, the local Ivy cache would be looked up first, and if that was not successful, then artifactory would be checked for both shared and public lookups. This meant that we would cache those dependencies which were available publicly in Maven, speeding up the second, and all subsequent lookups.

Using Ivy to get the dependencies in the Ant files

Penultimately (is that a word? I doubt it), we created an ivy.xml file containing all our dependencies and different configurations:

<ivy-module version="2.0">
    <info organisation="example" module="example-dummy" />

    <configurations>
        <conf name="base" description="Jars required at both compile and runtime" />
        <conf name="taskdefs" description="Jars required for Ant Taskdefs" />
        <conf name="compile" description="Jars required at compile / package time" />
        <conf name="deploy" description="Jars required at deploy time" />
        <conf name="test" description="Jars required at test time" />
    </configurations>

    <dependencies>
        <dependency org="oracle/soa/bpel" name="orabpel" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/soa/bpel" name="orabpel-validator" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/soa/bpel" name="orabpel-common" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/soa/bpel" name="orabpel-thirdparty" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/soa/fabric" name="fabric-runtime" rev="11.1.1" conf="compile,taskdefs->default" />
        <dependency org="oracle/soa/mgmt" name="soa-infra-mgmt" rev="11.1.1" conf="compile,taskdefs->default" />
        <dependency org="oracle/soa/fabric" name="soa-infra-tools" rev="11.1.1" conf="compile,taskdefs->default" />
        <dependency org="oracle/soa/fabric" name="testfwk-xbeans" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/fabriccommon" name="fabric-common" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/xdk" name="xmlparserv2" rev="11.1.0" conf="compile->default" />
        <dependency org="commons-logging" name="commons-logging" rev="1.0.4" conf="compile->default" />
        <dependency org="commons-digester" name="commons-digester" rev="1.7" conf="compile->default" />
        <dependency org="commons-beanutils" name="commons-beanutils" rev="1.6" conf="compile->default" />
        <dependency org="commons-collections" name="commons-collections" rev="3.2.1" conf="compile->default" />
        <!--dependency org="commons-cli" name="commons-cli" rev="1.1" conf="compile,deploy->default" /-->
        <dependency org="oracle/commonj-sdo" name="commonj-sdo" rev="2.1.0" conf="compile->default" /> <!-- This is a hack as the Oracle JDeveloper one is different from the one in M2 repositories -->
        <dependency org="oracle/logging-utils" name="oracle.logging-utils" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/dms" name="dms" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/webservices" name="orawsdl" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/mds" name="mdsrt" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/jmx" name="jmxframework" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/adf/share" name="adf-share-base" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/adf/share" name="adf-logging-handler" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/odl" name="ojdl" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/http-client" name="oracle-httpclient" rev="11.1.1" conf="compile,deploy->default" />
        <dependency org="oracle/wsm/common" name="wsm-policy-core" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/classloader" name="oracle-classloader" rev="11.1.1" conf="compile->default" />
        <dependency org="com/bea/core" name="com-bea-core-apache-commons-lang" rev="2.1.0" conf="compile->default" />
        <dependency org="com/bea/core" name="com-bea-core-xml-xmlbeans" rev="2.2.0.0" conf="compile->default" />
    </dependencies>
</ivy-module>

NOTE: I haven’t managed to get Ivy to load configurations for the taskdefs yet (see below). I’ll update this post when I get it to work

NOTE: Only the configurations for compile/package and deploy are included in this. It’s pretty easy to add the declarations for the other paths you need to set. I’ll repost this once it’s complete.

The final step was to add Ivy support to the out-of-the-box ant files.  To do this we;

  1. Added the ivy.jar to our ant/lib directory
  2. Added the Ivy namespace to the ant file: 
  3. <project xmlns:ivy="antlib:org.apache.ivy.ant"
             name="ant-scac"
             default="scac">

  4. Removed the elements setting all classpaths (e.g. scac.tasks.class.path in ant-scac-compile.xml)
  5. Added a new path declaration just for the taskdefs. E.g.: 
  6. <!-- Set the Path we need for the Ant Taskdefs -->
        <property name="oracle.ant.taskdef.path" refid="oracle.ant.taskdef.path"/>
        <path id="oracle.ant.taskdef.path">
            <fileset dir="${applications.home}/lib">
                <include name="fabric-runtime.jar"/>
                <include name="soa-infra-mgmt.jar"/>
                <include name="soa-infra-tools.jar"/>
            </fileset>
        </path>

  7. Updated the taskdef declaration elements to use this new path. E.g:  <taskdef name="scac" classname="oracle.soa.scac.scac" classpath="${oracle.ant.taskdef.path}" />
  8. Added a new “init” task which sets the path we removed earlier (e.g. scac.tasks.class.path in ant-scac-compile.xml):
  9. <target name="init" description="Sets up the compilation classpath">
            <ivy:resolve />
            <ivy:cachepath conf="compile" pathid="scac.tasks.class.path" />
            <property name="scac.tasks.class.path" refid="scac.tasks.class.path"/>
        </target>

  10. Updated the targets to have a dependency on “init”. E.g.:
  11. <target name="scac" description="Compile and validate a composite" depends="init">
            <scac input="${scac.input}"
                  outXml="${scac.output}"
                  error="${scac.error}"
                  appHome="${compositeDir}"
                  failonerror="true"
                  displayLevel="${scac.displayLevel}">
            </scac>
        </target>

And that’s it. Unfortunately there’s not a zip file you can download with a few bat/sh files to run, but maybe I’ll get there one day. In the meantime, this should help you to get where we have.

Email ThisBlogThis!Share to XShare to Facebook
Posted in | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • (no title)
    The Significance and Importance of Quotes in JSTL EL I just spent a few hours debuggung a null pointer in a Portlet JSP I'm writing. It...
  • (no title)
    Agile Development Ramblings: Part I Introduction I've just completed my first Agile development project. We developed a fully functiona...
  • EJB 3.0 Outside the Container, Inside the JVM - Part 2: Configuring JPA Declaratively
    Welcome to part two of this blog entry introducing using EJB3.0 inside the JVM. Click here to view the first part. As we've seen, JPA ...
  • Reuse (ii): Definition of Done
    As I said in my previous post , our project has suddenly taken a new path. There are two bits of collateral which I'd recently produced...
  • Notes from the FindBugs BOF9231 at JavaOne 2007
    NOTE: These are my incomplete notes from the FindBugs BOF at JavaOne 2007. I got in late due to the crush outside so missed the start of th...
  • Writing Unit Tests to Ensure Your "@Transactional ... rollbackFor" Annotations are Honoured
    Thanks to Russ Hart for providing the info on how to get this to work.  I just cut and paste, and then blogged it. It's nice to write un...
  • (no title)
    Can Your Own Demo I found something great on t'internet the other day. I had been asked to do a demo of our new ystem to some users but...
  • JavaOne Bred Over-Enthusiasm...
    I want to build and fiddle with Wonderland , and my own JDK ! The problem is my graphics card sucks (I need acceleration) and I'm runnin...
  • Booting Apache Derby ("JavaDB") with your Java App's Startup
    If you're embedding the Derby RDBMS with your java desktop application and want it to start when you start your app, you need to make th...
  • STS and RTC – Getting them to Play Nice
    We’re developing our new app using Spring 3.0 RC1 and we want the best tools available. We’ve picked the following: SpringSource Tools ...

Categories

  • 0
  • 2008
  • ant maven pimp build javaone 2008
  • apple ipod touch
  • asm
  • blog new ruby
  • blogtag list
  • bond casinoroyale mashup mi6 film movie
  • build
  • bytecode
  • CI
  • cobertura
  • communityone 2008 nutter jvm scala jruby groovy davinci
  • communityone 2008 opensocial socialsite
  • communityone javaone keynote oreilly
  • configuration
  • cowley
  • css div layout column ie firefox safari example
  • custom
  • darkstar mpk20 wonderland java3d commaboration SL
  • dashboard rss communication news development
  • db2 database SQL max min howto tip
  • db2 database ibm lessons tips
  • db2 database load batch howto example
  • db2 import upload data howto command
  • debt technical java annotation
  • debugging tips javaone 2008
  • development web2.0
  • findbugs JavaOne 2008 pugh
  • findbugs JavaOne BOF notes
  • gafter closures java javaone notes
  • google trouble patriarchal patriarchy
  • groovy metaprogramming javaone 2008
  • grubby oss data generation project announce
  • guice javaone 2008
  • gwt maven howto example simple
  • howto
  • hudson
  • hudson CI javaone 2008
  • ibm
  • invokeDynamic jvm dynamic ruby javaone
  • itinerant web2.0 portable desktop
  • jacl was websphere wsadmin trace logging
  • james gosling sun java open source tech days second life SL
  • jar java manifest properties config howto tip
  • java
  • java applet javaone 2008 reloaded jnlp
  • java javafxscript javaone 2008 fxscript
  • java javaone 2007 07
  • java javaone 2008 bytecode cobertura asm singleton testability
  • javaone
  • javaone keynote gage schwarz javafx
  • javaone semantic web bof notes web3
  • jazz
  • jruby rails javaone charlesnutter thomasenebo
  • jruby ruby netbeans development
  • kill dead laptop computer rebuild restore
  • lessonslearned
  • mac osx java gui shellscript classpath problem solution
  • maven plugin unittest test packager
  • mylin mylar javaone eclipse 2008
  • netbeans development ide
  • netbeans development ide RC
  • netbeans maven2 profiling
  • netbeans ruby sun tech days visual web pack roman strobl
  • ola bini java javaone 2008 thoughtworks ruby jruby
  • openjdk java javaone javafx wonderland
  • overheard
  • pojo ejb3.0 jpa orm java example howto
  • rant
  • rest restful jsr311 java web2.0 javaone ts-6411
  • rome rss feed blog rss atom propono java javaone
  • rsa uml profile plugin howto
  • ruby inheritance example
  • ruby jruby rss xml hpricot
  • ruby unless example
  • scm
  • setup
  • subversion svn xp windows cleanup
  • sun java soa web2.0 netbeans opensource javacaps
  • sun tech days java derby database rdbms london
  • sun tech days london impressions
  • terracotta java javaone 2008 android gwt
  • tip
  • tips
  • vwp netbeans JPA howto
  • was jython scripting nfr ibm pmi jvm
  • was tpv jython scripting nfr ibm pmi
  • webrick ruby jruby actadiurna investigation code howto
  • workitem

Blog Archive

  • ►  2012 (1)
    • ►  October (1)
  • ►  2010 (8)
    • ►  November (1)
    • ►  October (3)
    • ►  June (1)
    • ►  May (1)
    • ►  February (1)
    • ►  January (1)
  • ▼  2009 (9)
    • ►  December (1)
    • ▼  November (5)
      • Hacking Oracle SOA Suite (11.1.1) builds to work w...
      • The Goods Delivered – SOA Suite “ant-sca-compile.x...
      • Monkey-Patching Oracle SOA Suite 11g Ant Files to ...
      • RSA 7.5.4 and RTC 2.0.0.1 – Getting them to play n...
      • STS and RTC – Getting them to Play Nice
    • ►  March (2)
    • ►  February (1)
  • ►  2008 (22)
    • ►  December (1)
    • ►  November (3)
    • ►  May (15)
    • ►  March (1)
    • ►  January (2)
  • ►  2007 (53)
    • ►  December (1)
    • ►  November (3)
    • ►  September (3)
    • ►  August (2)
    • ►  July (3)
    • ►  June (1)
    • ►  May (12)
    • ►  April (5)
    • ►  March (13)
    • ►  February (7)
    • ►  January (3)
  • ►  2006 (35)
    • ►  December (8)
    • ►  October (1)
    • ►  August (1)
    • ►  July (5)
    • ►  June (8)
    • ►  May (3)
    • ►  April (7)
    • ►  March (2)
Powered by Blogger.

About Me

Unknown
View my complete profile