Create ADF application with Maven
In this section, we walk through on how to create ADF application with maven.
JDeveloper 12C has built in Maven support, it creates Maven build file for most of the project types like ADF, Java, J2EE, BPM etc. with little or no manual configuration needed.
In this page, we walk through the below three steps that JDeveloper supports
- Create an ADF application with Maven archetype
- Create MAVEN build files for an existing project
Run Maven phases
|This tutorial uses JDeveloper Version: 12.2.1
Let’s go by One by one
1.Create an ADF application with Maven archetype
We are going to create an ADF application in this example using Maven. It creates an ADF application with three projects.
Open your JDeveloper
Go to File >> New >> Application as shown below
In the New gallery Wizard, Select Maven in the categories >> Select Generate from Archetype >> Click Ok
as shown below
- Click the search icon as shown below
- Type ADF in the search box and hit enter on your keyboard. It will find the ADF artifact from your local or remote maven repository and display it under Matching Archetype. Now select the ADF archetype as shown below and click Ok.
123 Note: The artifacts must be deployed to your local repository to do this step. Please click <a href="http://www.catgovind.com/bpm/bpm-deploy-oracle-bpm-12g-artifacts-in-to-local-maven-repository/" target="_blank">here </a>for the instruction to deploy the Oracle artifacts into your local repository.
Click Ok to complete the application creation
This will create ADF application and projects in your workspace. Here below is the example screenshot, the maven build file (POM ) is created at project and application level
In the next steps, we walk through the steps to create MAVEN pom file for an existing project
2.Create MAVEN build file for existing project
Assume we have an ADF project or we can use the application just we created above
Right click on the ‘ViewController’ and select Maven POM for Project as shown below
- Choose ‘Use this POM as the default for the project‘ to generate Maven POM files for all the projects then choose OJDEPLOY or OJMAKE to include the plugin in POM file to package the ADF projects.
- Click Ok.
- The MAVEN POM file is generated for all the existing projects and application as shown below
3. Run Maven phases
We have created Maven POM file for all the projects and application, Let’s go through some of the Maven phases JDeveloper supports. Right click the generated POM file and select Run Maven as shown below
By default, the Maven displays six maven phases
>> to delete the existing package file (usually present under the project deploy or target directory)
>> to compile all the java source file present src directory
Click test >> to run test cases
Click Package >> to package the project into jar / war / ear / war file as specified in your POM.XML
Click install >> to install the package file in local repository (c:\users\.m2\repository)
Click Site >> to generate project report
Click Goal Profiles >> to add more maven phase
Note: Once the POM file is generated, Edit the file and change the ORACLE_HOME and OJDEPLOY file path points to your location.
The views expressed on this blog are my personal views and do not necessarily reflect the views of my employer.
Please feeling free to reach me on any comments and feedbacks you have. Would be more than glad to listen and reply 🙂