Oracle by Example brandingBuild an ADF Application with Developer Cloud

section 0Before You Begin

This tutorial shows you how to build an Oracle Application Development Framework (Oracle ADF) application with Apache Maven and Oracle Maven Repository by using Oracle JDeveloper and Oracle Developer Cloud Service. This tutorial takes approximately 30 minutes to complete.

Background

Oracle Developer Cloud Service is a cloud-based software development Platform as a Service (PaaS) and a hosted environment for your application development infrastructure. It provides an open source, standards-based solution to develop, collaborate, and deploy applications within Oracle Cloud.

Oracle Developer Cloud Service can build Oracle ADF applications by using Maven, Oracle Maven Repository, JDeveloper, Oracle ADF libraries, and OJMake and OJDeploy utilities.

In this tutorial, you use the Oracle Alta UI Work Better sample application and configure it in JDeveloper to use Maven. You configure the Maven Project Object model (POM) file to access the Oracle Maven Repository to download Oracle ADF libraries, and to access the OJMake and OJDeploy utilities available on the Oracle Developer Cloud Service build system. You then create a job in Oracle Developer Cloud Service that runs a Maven build and generates the artifacts.

The Alta UI Work Better sample application is a demo application that uses the Alta UI to develop the most recent Oracle Cloud products.

What Do You Need?


section 1 Create a Team Server in JDeveloper

In this section, you learn how to create and use a Team Server in JDeveloper to clone an Oracle Developer Cloud Service project Git repository. You then add the sample Oracle ADF application files to the cloned Git repository, commit, and push the updates to the project Git repository.

A Team Server is an extension in JDeveloper that you can use to manage your Oracle Developer Cloud Service projects from the IDE. Using the Team Server, you can clone the project repositories to your local computer, perform Git actions, manage project issues, and view the status of project builds. The Oracle Developer Cloud Service Team Server extension is installed, by default, in JDeveloper.

  1. Open JDeveloper.
  2. From the Team menu, click Team Server, and then click Add Team Server.
    Team menu in JDeveloper
    Description of the illustration create_ts_01.png
  3. In the New Team Server dialog box, enter the following values, and click OK.
  4. In the Team tab, select Click here to select project.
    Team tab in JDeveloper
    Description of the illustration create_ts_03.png
  5. In the Developer Cloud Team Server list, click Login.
    Team Server list in the Team tab
    Description of the illustration create_ts_04.png
  6. In the Login to Team Server dialog box, enter the user name and password for your instance of Oracle Developer Cloud Service.
    Login to Team Server dialog box
    Description of the illustration create_ts_05.png
  7. Click Login. If you can't log in, configure the proxy settings of JDeveloper.
    The Team Server displays all projects that you own or that you're a member of.
    Team tab with your Oracle Developer Cloud Service projects
    Description of the illustration create_ts_06.png

section 2 Clone the Project Git Repository

  1. In the Developer Cloud Team Server project list, click ADF Sample Application.
    A project selected in the Team tab
    Description of the illustration clone_01.png
  2. Expand Sources and click the get link of the adf-sample-application.git repository.
    Project categories available for the open project
    Description of the illustration clone_02.png
  3. In the Get Sources from Oracle Developer Cloud Services dialog box, click Get from Developer Server.
    Get Sources from Oracle Developer Cloud Service dialog box
    Description of the illustration clone_03.png
  4. On the Welcome page of the Clone from Git wizard, click Next.
    Welcome page of the Clone from Git wizard
    Description of the illustration clone_04.png
  5. On the Remote Repository page, click Next.
    Remote Repository page of the Clone from Git wizard
    Description of the illustration clone_05.png
    The wizard picks the values for Repository URL, Username, and Password from the Team Server.
  6. On the Remote Branch page, click Next.
    Remote Branch page of the Clone from Git wizard
    Description of the illustration clone_06.png
    The page is empty because the Git repository being cloned is empty.
  7. On the Destination page, if necessary, update the following values and click Next. The Checkout Branch drop-down list is expected to be empty.
    • Destination: The path of the directory where you want to clone the Git repository
    • Clone Name: The name of the cloned Git repository directory
    Destination page of the Clone from Git wizard
    Description of the illustration clone_07.png
  8. On the Git Clone Summary page, click Finish.
    Git Clone Summary page of the Clone from Git wizard
    Description of the illustration clone_08.png
  9. In the New Gallery dialog box, click Cancel to close the dialog box.
    In the next section, you add the Oracle Alta UI Work Better Application to the cloned Git repository directory.

section 3 Commit and Push the ADF Application to Oracle Cloud Developer Service

  1. In the cloned repository directory, extract the contents of the Oracle Alta UI Work Better Application zip file (WorkBetterFaces1221.zip).
    Explorer view of the cloned Git repository directory
    Description of the illustration commitpush_01.png
  2. In JDeveloper, open the WorkBetterFaces application.
    Applications pane of JDeveloper
    Description of the illustration commitpush_02.png
  3. From the Team menu, select Git, and then select Add All.
    JDeveloper Team - git submenu
    Description of the illustration commitpush_03.png
  4. In the Add All dialog box, click OK.
    Add All dialog box of JDeveloper
    Description of the illustration commitpush_04.png
    After all files are added to the staging index, notice that the icons in the Applications window now show a plus (+) sign in the lower-left corner.
    Applications pane of JDeveloper
    Description of the illustration commitpush_05.png
  5. From the Team menu, select Git, and then select Commit All.
    Team - Git submenu of JDeveloper
    Description of the illustration commitpush_06.png
  6. In the Commit All dialog box, enter a comment in Comments, specify your name and email address in the Author and Commiter fields in the Name <email> format, and click OK.
    Commit All dialog box
    Description of the illustration commitpush_07.png
    Notice that the icons in the Applications window now show a yellow circle in the lower-left corner.
    Applications pane of JDeveloper
    Description of the illustration commitpush_08.png
  7. From the Team menu, select Git, and then select Push.
    Team - Git submenu of JDeveloper
    Description of the illustration commitpush_09.png
  8. On the Welcome page of the Push to Git wizard, click Next.
    Welcome page of the Push to Git wizard
    Description of the illustration commitpush_10.png
  9. On the Remote Repository page, click Next.
    Remote Repository page of the Push to Git wizard
    Description of the illustration commitpush_11.png
    The wizard picks the values for Repository URL, Username, and Password from the Team Server.
  10. On the Local Branch page, click Next.
    Local Branch page of the Push to Git wizard
    Description of the illustration commitpush_12.png
    The master branch was created when you committed the application files.
  11. On the Commits page, click Next.
    Commits page of the Push to Git wizard
    Description of the illustration commitpush_13.png
  12. On the Git Push Summary page, click Finish.
    Git Push Summary page of the Push to Git wizard
    Description of the illustration commitpush_14.png
    A Git Push progress bar appears in the Status bar of JDeveloper. Wait for JDeveloper to push all files to the project Git repository.
  13. After the Git Push is completed, open the project in the Oracle Developer Cloud Service web interface and verify the commit on the Project page.
    Project page of the Oracle Developer Cloud Service project
    Description of the illustration commitpush_15.png

section 4 Add the Maven POM File to the Oracle ADF Application

In this section, you add a Maven pom.xml file to an Oracle ADF application in JDeveloper.

  1. In JDeveloper, if you aren't using the Studio Developer role, from the Tools menu, select Switch Roles, and then select Studio Developer (All Features). Save all files and restart JDeveloper.
  2. Open the WorkBetterFaces application.
  3. From the File menu, select New, and then select From Gallery.
    File - New submenu of JDeveloper
    Description of the illustration add_maven_01.png
  4. In the New Gallery dialog box, select Maven in the General category, select Application POM in the Items list, and click OK.
    New Gallery dialog box
    Description of the illustration add_maven_02.png
  5. In the Create a Maven POM for the Application dialog box, select the Include packaging plugin information (uses ojdeploy) and Include compile plugin information (uses ojmake) check boxes and click OK.
    Create a Maven POM for the Application dialog box
    Description of the illustration add_maven_03.png
    A pom.xml file is added to the ADF application.
    Application Resources pane
    Description of the illustration add_maven_04.png

section 5 Configure the POM File to Access Oracle Maven Repository, OJMake, and OJDeploy

In this section, you configure the POM file to access the Oracle Maven Repository and to use the OJMake and OJDeploy utilities. The OJMake and OJDeploy utilities are available on the build system of Oracle Developer Cloud Service and can be accessed by using Oracle Developer Cloud Service system environment variables.

  1. In JDeveloper, double-click pom.xml to open it in the editor.
    General tab of the POM file editor
    Description of the illustration config_maven_01.png
  2. Click the Repositories tab.
    Repositories tab of the POM file editor
    Description of the illustration config_maven_02.png
  3. In the Remote Repositories section, click Add theAddRepositoryicon.
  4. To add the Oracle Maven Repository as a remote repository, enter the following values:
    • Name: OracleMaven
    • ID: maven.oracle.com
    • URL: https://maven.oracle.com
    Remote Repositories section of the POM file editor
    Description of the illustration config_maven_03.png
  5. Click the Plugins tab.
    Plugins tab of the POM file editor
    Description of the illustration config_maven_04.png
  6. In the Plugin table, click the first column in the first row to select the ojmake plugin row.
    Plugins tab of the POM file editor
    Description of the illustration config_maven_05.png
  7. In the Configuration Parameters table, update the parameter value of the ojmake parameter to ${env.ORACLE_HOME_SOA_12_2_1}/jdev/bin/ojmake.
    Plugins tab of the POM file editor
    Description of the illustration config_maven_06.png
    The ORACLE_HOME_SOA_12_2_1 environment variable defines the path of the JDeveloper 12.2.1 directory that's installed on the Oracle Developer Cloud Service build executor.
  8. In the Plugin table, click the first column in the second row to select the ojdeploy plugin row.
    Plugins tab of the POM file editor
    Description of the illustration config_maven_07.png
  9. In the Configuration Parameters table, update the parameter value of the ojdeploy parameter to ${env.ORACLE_HOME_SOA_12_2_1}/jdev/bin/ojdeploy.
    Plugins tab of the POM file editor
    Description of the illustration config_maven_08.png
  10. Save the pom.xml file.

section 6 Create and Configure a Build Job in Oracle Developer Cloud Service

In this section, you configure a build job to run Maven and deploy the archived artifacts.

  1. In the Oracle Developer Cloud Service web interface, open your project and click Build in the navigation bar.
    Build option the Oracle Developer Cloud Service project navigation bar
    Description of the illustration config_build_01.png
  2. In the Jobs Overview page, click New Job.
    New Job button on the Jobs Overview page
    Description of the illustration config_build_02.png
  3. In the New Job dialog box, enter ADF_Maven_Build in the Job Name field and click Save.
    New Job dialog box
    Description of the illustration config_build_03.png
  4. On the Main tab of Configure build job, select JDK 8 in the JDK field. ADF 12c (12.2.1.0.0) applications require JDK 8.
    Main tab of the Configure Build job page
    Description of the illustration config_build_04.png
  5. Click the Source Control tab and select the Git option. In the Repositories section, select the adf-sample-application.git Git repository.
    Source Control tab of the Configure Build job page
    Description of the illustration config_build_05.png
  6. Click the Environment tab, select the Connect Oracle Maven Repository check box, and enter your Oracle Account user name and password.
    Environment tab of the Configure Build job page
    Description of the illustration config_build_06.png
  7. Click the Build Steps tab, click Add Build Step and select Invoke Maven 3.
    Build Steps tab of the Configure Build job page
    Description of the illustration config_build_07.png
  8. In the POM File field, enter WorkBetterFaces/pom.xml as the path of the POM file.
    Build Steps tab of the Configure Build job page
    Description of the illustration config_build_08.png
  9. Click the Post Build tab, select the Archive the artifacts check box, and enter WorkBetterFaces/target/*.ear in Files To Archive.
    Post Build tab of the Configure Build job page
    Description of the illustration config_build_09.png
  10. Click Save.
  11. In the ADF_Maven_Build details page, click Build Now.
    Build Now button of the job
    Description of the illustration config_build_10.png
    Wait for the build to complete.
    Build Details page of the job
    Description of the illustration config_build_11.png
  12. After the build is completed, expand Artifacts of Last Build to view the archived artifacts.
    Build Details page of the job
    Description of the illustration config_build_12.png
  13. Click WorkBetterFaces_1.0-SNAPSHOT.ear to download the EAR file to your local computer.
  14. Click Console theConsoleicon to view the build console.
  15. To view the build status of ADF_Maven_Build in JDeveloper, on the Team tab, expand Builds.
    JDeveloper Team tab
    Description of the illustration config_build_13.png
  16. To refresh the project in Team Server, place your cursor over ADF Sample Application and click the Refresh icon.
    The Refresh icon of the Team tab
    Description of the illustration config_build_14.png

more informationWant to Learn More?