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.
Open application level POM file in Application Resources directory as shown below and observe the details.
Open project level POM file and observe the details.
Open System level POM file and observe the details.
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.
Deploy your Service Bus projects using mvn pre-integration-test (from Service Bus application directory).
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.
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/
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,
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!
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…
whats the command you are using?
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.
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
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.
did not get..it has taken a back seat so..have to check once again
Hi,
Using Maven can we create jar for individual components like only selected proxy service and few XQueries?
-Raj