Oracle has just released version 12.1.2 of the Fusion Middleware platform. This release includes some new support for build automation with Maven and for continuous integration. In this post I want to give you a quick tour of what is new. In a follow up post, I will go through a detailed example of using the new Maven features.
Fusion Middleware 12.1.2 includes WebLogic Server, Coherence, ADF and JDeveloper. In this release, Oracle has added the following capabilities to support customers use of Maven to build projects targeted at Fusion Middleware runtime environments:
- Maven archetypes to create new projects,
- Maven plugins to build projects for various target runtimes,
- Maven POMs that describe the Oracle-provided dependency JAR files – for client libraries, APIs, things needed during the build process, etc.,
- A ‘Maven Synchronization plugin’ that allows you to populate a (local or remote) Maven repository from a an Oracle Home, and
- New documentation – Fusion Middleware: Developing Applications with Continuous Integration.
WebLogic Maven Plugin
Let’s start the tour with the new WebLogic Maven Plugin. This new version, with Maven coordinates com.oracle.weblogic:weblogic-maven-plugin:12.1.2-0-0, provides a much more idiomatic implementation that the older Maven plugins that have shipped in WebLogic in the past. It supports all the same goals, plus some new ones. But the focus is more on the primary use case – continuous integration – and less on running individual goals from the command line without a POM. That is not to say that you cannot still run the individual goals from the command line, but the plugin is much more interesting when you start to consider what you can do with it when you start mapping goals on to Maven lifecycle phases.
Here are the goals supported by the weblogic-maven-plugin:
|install||Install WebLogic Server, from a zip or jar installer, optionally with a response file.|
|uninstall||Uninstall WebLogic Server.|
|create-domain||Create a (simple) WebLogic Domain from one of the provided domain templates, or one of your own. This is only intended for simple domains. For anything else, you should use the wlst goal.|
|start-server||Start a WebLogic AdminServer or managed server.|
|stop-server||Stop a WebLogic AdminServer or managed server.|
|appc||Run appc on the project to prepare it for deployment. This generates and compiles the classes needed to deploy EJB and JSP and validates the deployment descriptors.|
|ws-clientgen||Generate a web service client from a WSDL.|
|ws-wsldc||Generate artifacts and a skeleton Java implementation from a WSDL.|
|ws-jwsc||Build a JAX-WS web service.|
|distribute-app||Prepare for deployment by copying deployment files to the target servers and validating them.|
|deploy||Deploy an application (EAR, WAR, etc.)|
|redploy||Redeploy an application.|
|undeploy||Undeploy an application.|
|update-app||Update an application, using the provided plan.|
|list-apps||List the applications on a particular target (server, cluster).|
|start-app||Start an application.|
|stop-app||Stop an application.|
|wlst||Run a WLST script – using either the WebLogic Server wlst.sh or the ‘oracle_common’ one (which loads additional libraries).|
You can read detailed documentation of each goal, including details of the parameters, and example POMs in Chapter 3 of Fusion Middleware: Developing Applications for WebLogic Server.
I will be providing some examples of how to use the plugin in a followup post.
Coherence Maven Plugin
The Coherence Maven Plugin allows you to build applications for the new Coherence container. It has Maven coordinates com.oracle.coherence:maven-gar-plugin:12.1.2-0-0 and it introduces a custom packaging type of gar for the Coherence Grid Archive.
Here are the goals supported by the maven-gar-plugin:
|generate-descriptor||Populate a Maven repository from an Oracle Home|
|package||Package into a GAR|
|repackage||Run POF configuration code to enhance packaged GAR|
You can learn more about the Coherence Maven Plugin in action in a soon to be published from Tim Middleton from Coherence Product Management. I will update this post with a link when it is available.
A number of archetypes are provided to help you create new projects. These all create projects with some sample code and and appropriate POM in place. Each of these creates a POM which points to an Oracle-supplied hierarchy of parents. Here are the archetypes and parents (in bold) in 12.1.2:
com.oracle.maven:oracle-common:12.1.2-0-0 - com.oracle.weblogic:wls-common:12.1.2-0-0 - com.oracle.weblogic.archetype:basic-webapp:12.1.2-0-0 - com.oracle.weblogic.archetype:basic-webapp-ejb:12.1.2-0-0 - com.oracle.weblogic.archetype:basic-webservice:12.1.2-0-0 - com.oracle.weblogic.archetype:basic-mdb:12.1.2-0-0 - com.oracle.coherence:gar-common:12.1.2-0-0 - com.oracle.coherence:maven-gar-archetype:12.1.2-0-0
The parents are provided as a point of customization. If you want to specify some properties or behaviors at a product-wide or site-wide level, you can add them into these parent POMs.
Maven Synchronization Plugin
One of the challenges when using Maven with Fusion Middleware in the past, was that Oracle did not provide POMs describing the dependencies that you needed to compile, package and deploy various types of projects. In 12.1.2, these POMs are supplied with WebLogic Server, Coherence and ADF/JDeveloper. But you still need a convenient way to load these into your Maven repository – either your local developer repository, or a shared repository.
The other challenge is that Maven and Fusion Middleware make different assumptions about how installed software will be patched. When you apply a one off patch using OPatch, this could result in a JAR file being updated that is one of those dependencies you use in your Maven builds. But OPatch will not necessarily update any version numbers, so how does Maven know there is a new version of the dependency?
To address these challenges, Oracle has shipped a ‘Maven Synchronization Plugin’ which allows you to populate a Maven repository from an Oracle Home. This plugin will let you set up your Maven repository in the first instance, and it will find any changes after you patch you Oracle Home and populate those to your repository as well.
This plugin has the coordinates com.oracle.maven:oracle-maven-sync:12.1.2-0-0, and the main goal you will want to use is its push goal.
More to come
Expect some more information, samples and videos soon 🙂