Capgemini Oracle Blog

Capgemini Oracle Blog

Opinions expressed on this blog reflect the writer’s views and not the position of the Capgemini Group

Version information in the OSB servicebus console

Categories : How-toSOA

In this blog I will describe two simple methods to include version information in your OSB application. This information is shown in the sbconsole, within the "description" field of the OSB project, or Proxy and BusinessServices. Version information is very useful in complex, dynamic environments like in a full dev/test/pre-prod/prod environment, and/or when branches in the sourcecode repository are used. Subversion information in Proxy or BusinessServices. This is simply achieved in the Workshop editor by having subversion automatically update the keyword placeholders that are located in the "description" field of the Proxy or BusinessService. For instance enter the following two placeholders:

$Id$ $HeadURL$
Of course the automatic subversion update needs to be enabled for the source file. Using for instance the subclipse plugin in Workshop: right-click the BusinessService, select "Team", "Set Property...". In the property dialog, select property name: "svn:keywords", and enter the keywords separated by a space character: Id HeadURL When the BusinessService is committed, the version information is set and after the deployment of the OSB project the result will look similar to this in the sbconsole: POM version in OSB project description. In my current project we use Maven to export the configuration JAR for the deployment. In this framework, ANT scripting is used to perform the actual export. There seems to be no direct way to set the project descripton using any scripting. Therefore we use ANT scripting to post-process the configuration JAR. These are the steps:
  1. un-jar the configuration JAR
  2. search in the file "_projectdata.LocationData" for the <proj:description/> tag, and insert the POM version (or any other information)
  3. re-jar the configuration JAR
This is the ant script:
<target name="insertPOMVersion">
    <echo message=">>> updating ${configurationJAR}" />
    <delete dir="${dir.tmp}" />
    <mkdir dir="${dir.tmp}" />
    <unzip src="${configurationJAR}" dest="${dir.tmp}" />
    <replace file="${dir.tmp}/${}/_projectdata.LocationData">
        <replacefilter token="proj:description/"
            value="proj:description>${POM.version}&lt;/proj:description" />
    <delete file="${configurationJAR}" />
    <zip destfile="${configurationJAR}">
        <fileset dir="${dir.tmp}">
            <include name="**" />
Notice that the ANT replace command does not handle < and > very well. These characters are therefore not in the search string and there is a &lt; in the replace value. The result will look like this: This post is by John Chin-a-Woeng, Senior Oracle SOA Suite Consultant for Capgemini

About the author

Arjan Kramer
Arjan Kramer
As a Digital Solution Architect Arjan Kramer realizes Digital Business Vision and Strategies by translating them into tangible solutions. In this role he is currently responsible for one of Capgemini's Global Digital Customer Experience Service offerings called OCommerce. This offering is a solution based upon several Oracle products in the Customer Experience domain, spanning Marketing, Sales and Service capabilities, including eCommerce. This solution is offered as a single integrated solution for all-channel Commerce and CRM. His 15+ year experience in IT, implementing CRM, Online and Social solutions and integrating those into existing landscapes for several global organizations makes him the best suitable man for this job.

Leave a comment

Your email address will not be published. Required fields are marked *.