Hardcore DevOps: Building A Portable Weblogic Client on the CLI |
Written by Nikos Vaggalis | ||||||||
Monday, 18 September 2017 | ||||||||
Page 4 of 4
Step 8 - The fat jar $ mvn -X -e clean install -DskipTests=true running the command gives : [INFO] ------------------------------------------------------------------------ Apparently the 'org.codehaus.plexus:plexus-utils:jar:3.0.5' artifact could not be resolved.Let's help Maven by manually feeding it a newer version from the central repository:
and try again: $ mvn -X -e clean install -DskipTests=true this time giving: [DEBUG] Failure to find com.oracle.weblogic:com.oracle.webservices.mdds-jersey-api_12.1.3/maven-metadata.xml in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced [DEBUG] Could not find metadata com.oracle.weblogic:com.oracle.webservices.orasaaj-rt-api_12.1.3/maven-metadata.xml in local (/home/test/.m2/repository) [DEBUG] Skipped remote request for com.oracle.weblogic:com.oracle.webservices.orasaaj-rt-api_12.1.3/maven-metadata.xml, locally cached metadata up-to-date. [DEBUG] Failure to find com.oracle.weblogic:com.oracle.webservices.orasaaj-rt-api_12.1.3/maven-metadata.xml in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced [DEBUG] Could not find metadata com.oracle.weblogic:com.oracle.webservices.session-manager-impl_12.1.3/maven-metadata.xml in local (/home/test/.m2/repository) [DEBUG] Skipped remote request for com.oracle.weblogic:com.oracle.webservices.session-manager-impl_12.1.3/maven-metadata.xml, locally cached metadata up-to-date. [DEBUG] Failure to find com.oracle.weblogic:com.bea.core.descriptor_2.2.0.0/maven-metadata.xml in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced [DEBUG] Could not find metadata com.oracle.weblogic:com.bea.core.compat.wl.90_1.6.0.0/maven-metadata.xml in local (/home/test/.m2/repository) [DEBUG] Skipped remote request for com.oracle.weblogic:com.bea.core.compat.wl.90_1.6.0.0/maven-metadata.xml, locally cached metadata up-to-date.
It looks like that Maven tries to resolve dependencies such as $ mvn -X -e -o clean install -DskipTests=true
This overcomes the previous build errors and goes into the bundling phase: [DEBUG] adding entry com/oracle/state/provider/aggregate/AggregateObject$Description.class
Step 9 - Validation Running: $ jar tf target/wlogicclient-jar-with-dependencies.jar generates a list of what's included inside the final jar : org/ and so on.
Now at last, let's run the jar with: $ java -jar target/wlogicclient-jar-with-dependencies.jar which gives : Hello World with WebLogic dependencies! Transferring the very same jar file to one of the other 10 machines as well as running it, worked as advertised, no questions asked. Of course this manual building process has its downsides too, merely that during the 'install' phase you might potentially encounter all sorts of exotic errors that vary from machine to machine.For example in replicating the same setup in another development CentOS machine, the install phase was halting with a very peculiar error: [ERROR] The exotic part is '12.1.3,12.1.4', versions that do not exist in Oracle's repository nor in the local cache and it really beats me how they got there in the first place! The solution I was forced to give was drastic;operate on the pom file stored in the local cache and change all occurrences of [12.1.3,12.1.4) to 12.1.3-0-0, the actual version residing in the Oracle repository.
<dependency> This relieved the error condition of the 'weblogic-server-pom' instance, but on subsequent runs all other poms were complaining too so this was a generalized situation that had to be taken care of by intrusively operating on all Weblogic related pom files inside the local repo.
$ cd /home/test/.m2/repository/com/oracle
Talking about total control and the CLI... Point is that you just might get unlucky, mileage varying, therefore you have to be ready to improvise, think out of the box and put your devops skills to use if and when the need arises. The good part is that these are edge case scenarios which are going to be encountered just once on the development machine.The rest will get the goods for free...
More InformationGitHub repo of this article's project Fusion Middleware Programming Stand-alone Clients for Oracle WebLogic Server Fusion Middleware Getting Started With JAX-RPC Web Services for Oracle WebLogic Server Apache Maven Central Repository Related ArticlesAWS Lambda For The Impatient Part 1 AWS Lambda For The Impatient Part 2 AWS Lambda For The Impatient Part 3 To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.
Comments
or email your comment to: comments@i-programmer.info |
||||||||
Last Updated ( Monday, 18 September 2017 ) |