Although the SOA and OSB Maven artifacts provided in the 184.108.40.206 release are much improved from what was released in 220.127.116.11, this topic provides some additional tweeks needed to get an OSB project to build and deploy with Maven.
There are two OSB 18.104.22.168 POM's in the installed FMW Middleware home that need to be corrected. The changes described here will be made in the Middleware home and not in the local Maven repository, in the event you have not run the Oracle Sync:Push yet. However, if you have already run Sync:Push then the deploy-file section at then end of the blog will correct the faulty POMs in your managed Maven repo. (If you're using a local Maven repository then simply change the POMs in the local repo and you're done.)
Note: The ORACLE_HOME environment variable is set in the examples below to the installed FMW Middleware home. The POM files to be corrected have periods in the file name and don't reflect the files deployed to the Maven repo, which contain hyphenated minor release and revision numbers.
Modify the POM in: "%ORACLE_HOME%\osb\plugins\maven\com\oracle\servicebus\sbar-project-common\22.214.171.124\sbar-project-common-126.96.36.199.pom".
The POM parent element was referencing 12.2.1-1-0 but needs to be changed to 12.2.1-2-0, as shown below.
<parent> <groupId>com.oracle.maven</groupId> <artifactId>oracle-common</artifactId> <version>12.2.1-2-0</version> </parent>
This POM can be found in: "%ORACLE_HOME%\osb\plugins\maven\com\oracle\servicebus\plugin\oracle-servicebus-plugin\188.8.131.52\oracle-servicebus-plugin-184.108.40.206.pom". Change the client artifact dependency versionId, as shown below.
<dependency> <groupId>com.oracle.servicebus</groupId> <artifactId>client</artifactId> <version>12.2.1-2-0</version> <type>pom</type> </dependency>
Deploy-File Maven Scripts
If you've made the above changes before running the Sync:Push tool then you're done. However, if you have already run Sync:Push then the deploy-file commands below (formatted for Windows) can be run after the fact, to correct the POMs on the managed Maven repo.
In the directory where you changed the POM, make a copy of the POM: "copy sbar-project-common-220.127.116.11.pom sbar-project-common-12.2.1-2-0.pom" to create a version with the hyphenated POM name.
Change the "url" element to your managed repository.
- There is no JAR file associated with this deploy so the generatePom is set and the file references the copied POM.
mvn deploy:deploy-file ^ -Durl=http://your-server:8081/artifactory/FmwRepository ^ -Dfile=%ORACLE_HOME%/osb/plugins/maven/com/oracle/servicebus/sbar-project-common/18.104.22.168/sbar-project-common-12.2.1-2-0.pom ^ -DgroupId=com.oracle.servicebus ^ -DartifactId=sbar-project-common ^ -DgeneratePom=false ^ -Dversion=12.2.1-2-0
- In the directory where you changed the POM, make a copy of the POM, to create a file with the hyphenated file name to be deployed: "copy oracle-servicebus-plugin-22.214.171.124.pom oracle-servicebus-plugin-12.2.1-2-0.pom".
- Change the "url" element to your managed repository.
- There is a JAR file associated with the POM but it should be good to go, so the generatePom is set and the file references the copied POM.
mvn deploy:deploy-file ^ -Durl=http://your-server:8081/artifactory/FmwRepository ^ -Dfile=%ORACLE_HOME%/osb/plugins/maven/com/oracle/servicebus/plugin/oracle-servicebus-plugin/126.96.36.199/oracle-servicebus-plugin-12.2.1-2-0.pom ^ -DgroupId=oracle-servicebus-plugin ^ -DartifactId=oracle-servicebus-plugin ^ -DgeneratePom=false ^ -Dversion=12.2.1-2-0