With the availability of Fusion Middleware 12c the usage of Apache Maven as build management tool kit has been dramatically improved. In the past many workarounds were implemented to use Apache Maven in projects using Oracle Fusion Middleware technologies. An example was the usage of an ANT-Maven bridge in SOA Suite projects. 

Apache Maven is a well proven and established technology to manage the complete build management lifecycle in Java projects. The main advantage of Maven from my perspective is the dependency management for libraries and a standardized project structure. Maven can be customized with a strong plugin (available plugins) mechanism and project templates called archetypes.

In this series of planned blog posts I would like to show how to effectively use Maven with Oracle Fusion Middleware. The following topics will be included:

  • Populate Oracle Java libraries  in a Maven repository
  • Prepare JDeveloper for Maven
  • Use Maven Oracle Fusion Middleware Archetypes in JDeveloper and Command line
  • Create your own custom Archetype 
  • Configure Oracle Maven Repository

So stay tuned in the next view weeks.

Populate Oracle Java libraries  in a Maven repository

1. Install Oracle Maven Synchronization Plugin

The first step before using Maven is to make the Oracle Java libraries available in a Maven repository. The easiest way is to configure the Oracle Maven Repository. It has been announced  for some weeks. The usage of the Oracle Maven Repository will be shown in another blog post later. Another possibility is to populate the Oracle Java libraries. Oracle offers a Maven Plugin called “Oracle Maven Synchronization Plugin” for this task. The first step is to install and configure this plugin. The plugin is available in a Fusion Middleware or JDeveloper 12.1.3. installation.

Location:

$ORACLE_HOME/oracle_common/plugins/maven/com/oracle/maven/oracle-maven-sync/12.1.3/oracle-maven-sync.12.1.3.pom
$ORACLE_HOME/oracle_common/plugins/maven/com/oracle/maven/oracle-maven-sync/12.1.3/oracle-maven-sync.12.1.3.jar

Example: $ORACLE_HOME=/oraapps/developer121300

Use the following commands to install the plugin in a local Maven repository

Use the following command to install the plugin in a remote Maven repository

Tip: repositoryId have to be correctly configured in the central Maven configuration file settings.xml!

2. Load Oracle Java libraries

Use the following commands to install the plugin in a local Maven repository

Use the following command to install the plugin in a remote Maven repository

Tip: serverId have to be correctly configured in the Maven configuration file settings.xml!

Notes:

  • The documentation describes the parameter testingOnly. However this parameter does not work. Use dryRun instead.
  • When the plugin is called several times against the same repository the parameter overriteParents should be used to control the update behaviour.

2.1 Load Oracle Java libraries to Artifactory

Artefactory repository configuration

 Ensure that the target repository has the option Handle Releases activated.

2.2 Load Oracle Java libraries to Nexus

Nexus Repository Manager

 Please ensure that in Nexus the configuration for Access Settings -> Deployment Policy is set to Option Allow Redeploy. Otherwise the Oracle plugin will run into errors.

3. Browse Oracle Java libraries in the Maven repository

Oracle Java Libraries in Artefactory

 After a successful run of the Oracle Maven Synchronization Plugin the libraries can be browsed in the corresponding repository, like Artifactory.

Other useful commands

1. Show parameters and options of the Oracle Maven Synchronization Plugin

2. Update the Archetype catalog. Needed to update the list of available Archetypes in the repository manually

Next blog post

The next blog post will discuss how to configure Maven in JDeveloper. Furthermore how to configure JDeveloper and Maven to use MDS to share WSDL/XSDs files. I will also give some best practices from current projects using these technologies.

Weblinks