This chapter provides details on how to use the Oracle Application Development Framework Maven archetypes to create, build, and deploy Oracle Application Development Framework applications.
This chapter includes the following sections:
For more information about using the Oracle ADF development plug-in with Maven, see "Building and Running with Apache Maven " in Developing Applications with Oracle JDeveloper.
Two Maven plug-ins and an archetype are provided for Oracle ADF projects. Table 12-1 describes the Maven coordinates.
Table 12-1 Maven Coordinates with Oracle ADF
Artifact | groupId | artifactId | Version |
---|---|---|---|
ADF ojmake plug-in |
com.oracle.adf.plugin |
ojmake |
12.1.3-0-0 |
ADF ojdeploy plug-in |
com.oracle.adf.plugin |
ojdeploy |
12.1.3-0-0 |
ADF archetype |
com.oracle.adf.archetype |
oracle-adffaces-ejb |
12.1.3-0-0 |
JDeveloper also has extensive support for Maven. This documentation covers Maven use outside of JDeveloper. Refer to "Building and Running with Apache Maven" in Developing Applications with Oracle JDeveloper for more details about using Maven within JDeveloper.
To create a new Oracle ADF Application using the Oracle ADF Application Maven archetype, issue a command similar to the following:
mvn archetype:generate -DarchetypeGroupId=com.oracle.adf.archetype -DarchetypeArtifactId=oracle-adffaces-ejb -DarchetypeVersion=12.1.3-0-0 -DgroupId=org.mycompany -DartifactId=my-adf-application -Dversion=1.0-SNAPSHOT
This command runs Maven's archetype:generate
goal which allows you to create a new project from an archetype. Table 12-2 describes the parameters.
Table 12-2 Parameters for the Oracle ADF Project
Parameter | Purpose |
---|---|
archetypeGroupId |
Identifies the groupId of the archetype that you want to use to create the new project. This must be com.oracle.adf.archetype in the example. |
archetypeArtifactId |
Identifies the artifactId of the archetype that you want to use to create the new project. This must be oracle-adffaces-ejb as shown in the example. |
archetypeVersion |
Identifies the version of the archetype that you want to use to create the new project. This must be 12.1.3-0-0 as shown in the example. |
groupId |
The groupId for your new project. This usually starts with your organization's domain name in reverse format. |
artifactId |
The artifactId for your new project. This is usually an identifier for this project. |
version |
The version for your new project. This is usually 1.0-SNAPSHOT for a new project. |
You can also run the command without any arguments, as shown in the following example. In this case, Maven displays a list of available archetypes and prompts you to enter the required information.
mvn archetype:generate
After you have written your code, you can use Maven to build the project.
To compile your project, execute the following command:
mvn compile
This command runs the ojmake plug-in.
To package the project into an EAR file, execute the following command (note that this actually runs all steps up to package, including the compile again):
mvn package
This command runs the ojdeploy plug-in.