Existing Bugs and Issues with Maven and OSB 22.214.171.124 and How to Fix Them
It is a well known fact that Maven in OSB 126.96.36.199 came with glitches that required manual fixes as described in Robert Patrick’s blog posting and in the Oracle support notes Doc ID 2186338.1. However, this article is centered around the latest OSB 188.8.131.52, its particular Maven issues and how to fix them. Same as version OSB 184.108.40.206 also 220.127.116.11 suffers from various maven glitches, however in a more subtle way.
[Note, that I usually don’t post references to MOS, since not everybody has access to it. Anyway, if you cannot access to Doc ID 2186338.1 don’t worry. It basically describes what Robert writes about in his blog. In addition it recommends actually not to fix it manually, but instead wait for a patch. I actually I agree. Also note that as of OSB 18.104.22.168 this issue is not marked as fixed although the behavior of the newest version is different.]
The current situation with OSB 22.214.171.124 and Maven is “interesting”, to put it mildly:
- mvn with OSB 126.96.36.199 and the maven push plugin only will not work out of the box. This means the official documentation won’t help you in this case. The good news – despite the fact that mvn with OSB 188.8.131.52 is not working correctly – is that it is rather easy to fix manually (see below, Fix 1: Maven with OSB 184.108.40.206 and the mvn push plugin).
- Also mvn with OSB 220.127.116.11 and maven.oracle.com will not work (as of Jan 7, 2017). Since the required .pom and .jar files are pulled over from maven.oracle.com and several of them are missing it is obviously not easy to fix it yourself.
- Here comes the crazy part (well, crazy on an IT scale): if you configure both, i.e. first use the OSB Maven plugin to push from an OSB 18.104.22.168 ORACLE_HOME into the .m2 repository, and then in addition configure the maven.oracle.com repository, then it is done twice. Yet then also both issues cancel each other out.
Here are the fixes, as promised
Fix 1:Maven with OSB 22.214.171.124 and the mvn push plugin
a) easy manual fix, updating two lines in two files:
After usign the push plugin, in .m2 Repository, e.g. D:\Users\frank\.m2\repository\com\oracle\servicebus\sbar-system-common\12.2.1-2-0 change the file sbar-system-common-126.96.36.199.pom as follows:
<parent> <groupId>com.oracle.maven</groupId> <artifactId>oracle-common</artifactId> <version>12.2.1-1-0</version> </parent>
change the version tag to <version>12.2.1-2-0</version>
also for the file sbar-project-common-188.8.131.52.pom in the directory
.m2\repository\com\oracle\servicebus\sbar-project-common\12.2.1-2-0 change the version number the same way.
b.) Install patch 22392646
This is the second, alternative option to fix the issue. Install patch 22392646 from My Oracle Support. After a lengthy and tiring discussion I had with support it is now also applicable to OSB 184.108.40.206. – voilà! Depending on your provisioning approach this might be the easier fix, but actually you could just copy over the files (or even run sed on those two files).
Issue 2: Maven with OSB 220.127.116.11 and the maven.oracle.com
There is no known fix at the moment, maven.oracle.com is missing a whole lot of files (again) and also some of those delivered are wrong again. Bug 23698828 describes a very similar issue, yet reports it as fixed for 18.104.22.168. Oracle support knows about it, so let’s hope it will be fixed soon in maven.oracle.com. I will keep you posted, promised.
Update: After the first round with support their “solution” did not work. The issue is still not fixed. If you think about it for a second, how hard can it be to push a patched .m2 repo to maven.oracle.com? Stay tuned 🙂
You are lucky if you simply retyped all the instructions available and configured both ways to use Maven with OSB 22.214.171.124 (although I somehow guess you would have not read this article then).
As soon as you follow a clear path and either go for the push plugin on a machine with OSB installed, or maven.oracle.com on a build server without an OSB installation, you will run into issues. It is obvious that Oracle would do good with automatically testing this functionality for future releases. Not being able to browse the maven.oracle.com repo makes it more difficult for customers to debug those issues, so it might be a good idea to use a local proxy / cache.
Let me know your feedback!