SOA 12c – Using Maven for Service Bus deployment

In this post, we will see creation of Service Bus application and projects using maven archetypes. And we will use local Maven Repository for demonstration.

Generate Service Bus Application and Project as shown below.

mvn archetype:generate -DarchetypeGroupId=com.oracle.servicebus.archetype -DarchetypeArtifactId=oracle-servicebus-application -DarchetypeVersion=12.1.3-0-0 -DgroupId=org.my.test -DartifactId=test-servicebus-application -DprojectName=test-servicebus-project -Dversion=1.0-SNAPSHOT

Import this maven project in JDeveloper using the steps mentioned below. Select File –> Import and select Maven Project option and click OK.

import1

osbimport

osbappl

osbimported

Open application level POM file in Application Resources directory as shown below and observe the details.

osbapplpom

osbapplpom1

Open project level POM file and observe the details.

osbprojpom

Open System level POM file and observe the details.

osbsyspom

Add plugin and other server details in project level POM files (both System and Service Bus Project) as shown below. Remember using the Admin Server port as the server url.

<build>
<plugins>
<plugin>
<groupId>com.oracle.servicebus.plugin</groupId>
<artifactId>oracle-servicebus-plugin</artifactId>
<version>12.1.3-0-0</version>
<configuration>
<oracleServerUrl>
http://localhost:7001</oracleServerUrl>
<oracleUsername>weblogic</oracleUsername>
<oraclePassword>weblogic1</oraclePassword>
</configuration>
</plugin>
</plugins>
</build>

You can generate the sbar file for your Service Bus Projects using mvn package (from directory of Service Bus Application) and can be found in <<project>>/.data/ maven.

sbuspackage

Deploy your Service Bus projects using mvn pre-integration-test (from Service Bus application directory).

sbuspinttest

You can execute Service Bus Plugin goals in following manner from directory containing project POM file.

mvn com.oracle.servicebus.plugin:oracle-servicebus-plugin:package

mvn com.oracle.servicebus.plugin:oracle-servicebus-plugin:deploy**

You can observe goal prefix as servicebus, when you describe Service Bus Plugin as shown below.

osbgoalprefix

so you can execute all goals simply using this goal prefix as below.

mvn servicebus:package

mvn servicebus:deploy**

 

**Currently facing issue with deploy goal.

 

Notes:

  • Use double quotes in the maven commands like below if you are seeing the error mentioned in think link.

mvn install:install-file “-DpomFile=oracle-maven-sync-12.1.3.pom” “-Dfile=oracle-maven-sync-12.1.3.jar” “-DoracleHome=C:/Oracle/Middleware/FMW1213New”

  • Seems to be OSB maven functionality is broken in 12.2.1. Refer to following blog talking about this.

https://rhpatrickblog.wordpress.com/2015/11/11/restoring-osb-12-2-1-maven-functionality/

http://www.avioconsulting.com/blog/osb-12212-maven-fixes

Advertisement

10 Responses to “SOA 12c – Using Maven for Service Bus deployment”


  1. 1 Yang Yang August 17, 2018 at 6:11 PM

    Hi Siva,

    Thank you for the informative post. If we want to put a description as part of the deployment of OSB project so that it shows in the change center, are we able to do that with Maven? Thank you.

    Cheers,

  2. 2 Adrian MP July 22, 2017 at 1:34 AM

    Hello,

    Thanks for the great post.
    Is it possible to use maven to set some values using typical maven profile? I mean values like values of DVM.

    Thanks!

  3. 3 srikanthreddykv May 5, 2017 at 5:25 PM

    Hi Siva, nice post. I am able to package the application but unable to deploy it and getting below error.

    Failed to execute goal nl.whitehorses.servicebus:servicebus-plugin:1.1:deploy-assembly (deploy-assembly) on project Assembly: Unable to read artifact [C:\JDeveloper\maven-archetypes\mywork\OIDXExtensions\Assembly\target\sbconfig.sbar]: failed to unmarshal class java.lang.Object; nested exception is: java.lang.ClassNotFoundException: Failed to load class com.bea.wli.sb.util.RouterDiagnosticLocation

    Tried too many ways and followed below approach too.
    http://blog.whitehorses.nl/2017/01/12/building-osb-12c-releases-on-resource-level-using-maven/

    I don’t know, where I am missing? Unable to figure it out. Any alternate suggestion is much appreciated. Thanks…

    • 4 svgonugu May 8, 2017 at 9:35 AM

      whats the command you are using?

      • 5 srikanthreddykv May 25, 2017 at 3:42 PM

        Thanks for your time.
        I have used “mvn clean pre-integration-test” command to deploy artifacts to sbconsole.
        By the way, now, I am able to deploy it successfully.
        The problem is with my Middleware Home. Something missed from there. I have tested on another machine. Now I am able to deploy it.

        But I am unable to undeploy it. Is there any way to do it. Thanks in advance.

      • 6 srikanthreddykv June 16, 2017 at 2:23 PM

        Hi Shiva, I could not find “undeploy” goal anywhere. Could you please provide scripts for UNDEPLOY the servicebus application? Thanks in advance.

        When I tried with below command, I got error message like:
        Could not find goal ‘undeploy’ in plugin com.oracle.servicebus.plugin:oracle-servicebus-plugin:12.2.1-0-0 among available goals deploy, package -> [Help 1]

        Command: mvn com.oracle.servicebus.plugin:oracle-servicebus-plugin:undeploy -DoracleServerUrl=t3://localhost::7001 -DoracleUsername=weblogic -DoraclePassword=password -DconfigJar=/target/sbconfig.sbar

  4. 7 Sheerish Tanwar May 13, 2016 at 3:57 PM

    Hi Siva,

    Did you get any fix for mvn servicebus:deploy goal.
    I am able to run package goal but it is failing while executing the deploy goal.

  5. 9 Raj April 18, 2016 at 3:26 AM

    Hi,

    Using Maven can we create jar for individual components like only selected proxy service and few XQueries?

    -Raj


  1. 1 SOA 12c – Maven Articles | Siva's Blog Trackback on September 1, 2015 at 11:36 AM

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.




Pages

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 379 other subscribers

Enter your email address to follow this blog and receive notifications of new posts by email.


%d bloggers like this: