It seems that testing of the Oracle Service Bus (OSB) Maven functionality in the new 12.2.1 release failed to catch a few issues that make the OSB Maven plugin unusable out of the box. Oracle is aware of the issue and working to create a patch for this. In the meantime, users can work around the problem with a few simple changes. This blog documents those changes.
Fixing the com.oracle.servicebus:client POM
The first change we need to make is to edit the com.oracle.servicebus:client POM. This POM can be found at ${ORACLE_HOME}/osb/plugins/maven/com/oracle/servicebus/client/12.2.1/client-12.2.1.pom
. Open this file in a text editor and make the following changes.
- Delete the <dependency> stanza for the com.oracle.weblogic:wlthint3client. This artifact does not exist. Fortunately, it is is not needed since the weblogic-server-pom dependency provides all of the connectivity to WebLogic Server that is required.
- In the weblogic-server-pom dependency, change the <version> element’s value from “LATEST” to “[12.2.1,12.2.2)” (without the double quotes).
- In the com-bea-core-xml-xmlbeans dependency, change the <artifactId> element’s value from “com-bea-core-xml-xmlbeans” to “com.bea.core.xml.xmlbeans” (without the double quotes).
- In the com-bea-core-xml-xmlbeans dependency, change the <version> element’s value from “LATEST” to “[12.2.1,12.2.2)” (without the double quotes).
After making these changes, the relevant section of the file should look like the one shown here.
... <dependencies> <dependency> <groupId>com.oracle.weblogic</groupId> <artifactId>weblogic-server-pom</artifactId> <version>[12.2.1,12.2.2)</version> <type>pom</type> </dependency> <dependency> <groupId>com.oracle.weblogic</groupId> <artifactId>com.bea.core.xml.xmlbeans</artifactId> <version>[12.2.1,12.2.2)</version> </dependency> <dependency> <groupId>com.oracle.osb.common</groupId> <artifactId>oracle.servicebus.common</artifactId> <version>[12.2.1,12.2.2)</version> </dependency> ...
Fixing the com.oracle.servicebus:sbar-project-common Parent POM
The next change we need to make is to edit the com.oracle.servicebus:sbar-project-common POM. This POM can be found at ${ORACLE_HOME}/osb/plugins/maven/com/oracle/servicebus/sbar-project-common/12.2.1/sbar-project-common-12.2.1.pom
. Open this file in a text editor and make the following change.
- Change the <parent> section’s <version> element value from “12.1.4-0-0” to “12.2.1-0-0” (without the double quotes).
After making these changes, the relevant section of the file should look like the one shown here.
... <parent> <groupId>com.oracle.maven</groupId> <artifactId>oracle-common</artifactId> <version>12.2.1-0-0</version> </parent> ...
Fixing the com.oracle.servicebus:sbar-system-common Parent POM
The last change we need to make is to edit the com.oracle.servicebus:sbar-system-common POM. This POM can be found at ${ORACLE_HOME}/osb/plugins/maven/com/oracle/servicebus/sbar-system-common/12.2.1/sbar-system-common-12.2.1.pom
. Open this file in a text editor and make the following change.
- Change the <parent> section’s <version> element value from “12.1.4-0-0” to “12.2.1-0-0” (without the double quotes).
After making these changes, the relevant section of the file should look like the one shown here.
... <parent> <groupId>com.oracle.maven</groupId> <artifactId>oracle-common</artifactId> <version>12.2.1-0-0</version> </parent> ...
Populating the Maven Repository with the Changes
Now that you have made all of the required changes, simply run the com.oracle.maven:oracle-maven-sync plug-in to synchronize your Maven repository with the changed artifacts. If you are unfamiliar with the Oracle Maven Sync plug-in, please refer to the documentation here. If you already have the plug-in installed, simply run the command shown below (replacing the “${ORACLE_HOME}” with the actual path to your OSB 12.2.1 installation directory).
mvn com.oracle.maven:oracle-maven-sync:12.2.1-0-0:push -DoracleHome=${ORACLE_HOME}
At this point, the OSB Maven functionality should be restored for the local machine. If you have a Maven Repository Manager, you can use the Oracle Maven Sync plug-in to populate it with the corrected artifacts.
Working like a charm.
But if you happened to be dealing with the BPM instalation, be sure to add -DpushDuplicates=true while performing the sync operation.
IE: mvn com.oracle.maven:oracle-maven-sync:12.2.1-0-0:push -DoracleHome=${ORACLE_HOME} -DpushDuplicates=true
LikeLike
Please make the following changes to $ORACLE_HOME/osb/plugins/maven/com/oracle/servicebus/client/12.2.1/client-12.2.1.pom:
1.) Delete the dependency on wlthint3client.
2.) In the weblogic-server-pom dependency, replace the version with [12.2.1,12.2.2)
3.) In the com-bea-core-xml-xmlbeans dependency, change the artifactId from com-bea-core-xml-xmlbeans to com.bea.core.xml.xmlbeans and the version from LATEST to [12.2.1,12.2.2)
LikeLike
Thank you Robert it works now.
LikeLike
Pingback: How to fix Maven build problems in Oracle Service Bus 12c « Sysco – Gode historier
Hi Robert,
I’m having this issue while trying a mvn package:
org.apache.maven.plugin.PluginResolutionException: Plugin com.oracle.servicebus.plugin:oracle-servicebus-plugin:12.2.1-0-0 or one of its dependencies could not be resolved: Failed to collect dependencies at com.oracle.servicebus.plugin:oracle-servicebus-plugin:jar:12.2.1-0-0 -> com.oracle.servicebus:client:pom:12.2.1-0-0 -> com.oracle.weblogic:com-bea-core-xml-xmlbeans:jar:[12.2.1,12.2.2)
LikeLike
Pingback: SOA & BPM Community Newsletter August 2016 | SOA Community Blog
Pingback: OSB 12.2.1.2 with Maven — munz & more
Pingback: Restoring OSB 12.2.1 Maven Functionality by Robert Patrick | SOA Community Blog
Pingback: SOA 12c – Using Maven for Service Bus deployment | Siva's Blog
Thank you!
LikeLike