Using Oracle JDeveloper with Oracle Developer Cloud Service

Oracle JDeveloper enables you to develop applications and commit the files to the Oracle Developer Cloud Service Git repository. Similar to NetBeans IDE, JDeveloper also uses the Oracle Developer Cloud Service Team Server plugin to access Oracle Developer Cloud Service projects. The plugin is installed by default in JDeveloper.

Logging In to Oracle Developer Cloud Service

You can log in to Oracle Developer Cloud Service from the Team window.

To log in to Oracle Developer Cloud Service:
  1. From the Window menu, select Team to open the Team window.
  2. From the Team menu, select Team Server, then Add Team Server.
    Alternatively, click Add Team Server in the Team window.
  3. In the New Team Server dialog, select Oracle Developer Cloud Service in Provider, enter a unique name in the Name field and the Oracle Developer Cloud Service URL in the URL field.
    You will find the URL in email that you received when you signed up for the trial service or purchased the service. You can also contact the project Owner or the Identity Domain Administrator for the URL.
  4. Click OK.
  5. In the Team window, click Click here to select project to see the list of team servers. Click Login under the Oracle Developer Cloud Service team server.
  6. In the Login to Team Server dialog, enter the user name and password and click Login.

Using the Oracle Developer Cloud Service Team Server

After you log in, the Team window lists all projects of which you are a member. For each project, JDeveloper displays project information about build jobs, issues, and Git repositories.

From the Oracle Developer Cloud Service team server, you can do the following:

  • Create an Oracle Developer Cloud Service project

  • Open an existing project

  • Switch to another project

  • Log out from the Oracle Developer Cloud Service team server

Click the Oracle Developer Cloud Service team server Gear icon to perform the above actions.

Description of jdev_odcs_gearmenu.png follows
Description of the illustration jdev_odcs_gearmenu.png

Note:

By default, JDeveloper synchronizes information from all recently selected or opened projects of which you are a member or own. The information includes all issues, builds, and Git repositories. If you want to synchronize information for the selected project, click the Gear icon, select Auto Synchronize Services, and then Selected Project Only.

Creating an Oracle Developer Cloud Service Project in JDeveloper

You can create an Oracle Developer Cloud Service project in JDeveloper and then push its files to the hosted Git repository. You can also push an existing JDeveloper application to an empty Oracle Developer Cloud Service project Git repository.

To create an Oracle Developer Cloud Service project:
  1. From the Team menu, select Team Server, then Oracle Developer Cloud Service team server, then New Project.
    You may also select New Project from the Oracle Developer Cloud Service team server Gear menu.
  2. In the Name and License page of the New Project wizard, perform these steps:
    1. Enter a unique project name in Project Name.
    2. Enter a brief description of the project in Description.
    3. Select a Security setting.

      Private projects are accessible to invited members only.

      Shared projects are accessible to all members of the organization. Any member of the organization can view the source code, create or update issues, edit wiki pages, and interact with project builds. However, only project members and owners can push changes to the Git repository and perform deployment operations on the deployment configurations.

    4. Select the Wiki Markup language.
    For more information, see Creating a Project.
  3. Click Next.
  4. In the Source Code and Issues page of the New Project wizard, perform these steps:
    1. In the Local Repository Folder field, click Browse and select a local directory that you want to initialize as the project’s Git repository when the project is created.
    2. In the Folders or Projects field, click Add Project to add an add an existing NetBeans IDE project to the new Oracle Developer Cloud Service project. In the Open Project dialog, browse and select the project directory, and click Open Project.
      Click Add Folder to add the contents of a directory to a project. In the Open dialog, browse and select the directory, and click Open.

      If you do not want to add an existing project or directory, leave the Folders or Projects field blank.

  5. Click Next.
  6. In the Summary page, review the information and click Finish.
  7. After the project is successfully created in Oracle Developer Cloud Service, a dialog displays a message showing the local repository location. Click Close to close the dialog.

If you did not add an existing project in Step 4, then follow the steps described in Opening an Oracle Developer Cloud Service Project in JDeveloper to clone the hosted Git repository of the new project. After cloning the Git repository, add files to the project, commit them to the local Git repository branch and then push the branch to the hosted Git repository.

Opening an Oracle Developer Cloud Service Project in JDeveloper

You can open an Oracle Developer Cloud Service project in JDeveloper from the Team window. After opening the project, you can clone the hosted Git repository.

If the project is not already open, click the project name in the Team window, browse the list, and select the project.

If you have a long list of projects, click the Oracle Developer Cloud Service team server Gear icon and select Open Project. In the Search field of the Open Project dialog, enter the name of the project that you want to open, and click Search. To view all projects, leave the Search field empty and click Search.

To open and clone the Oracle Developer Cloud Service project:
  1. Open the project in the Team window.
  2. In the open project, expand Sources and click the get link of the Git repository you want to clone.
  3. In the Get Sources from Team Server dialog, verify the Git repository URL and click Get From Developer Server.
  4. In the Remote Repository page of the Clone Repository wizard, verify the repository URL, and click Next.
    The user name and password are automatically picked from the Team Server you are logged into.

    You might need to click the Back button of the wizard to open the Remote Repository page.

  5. If required, in the Remote Branches page of the Clone Repository wizard, select the branches that you want to clone and click Next.
  6. In the Destination Directory page of the Clone Repository wizard, perform these steps:
    1. Specify the directory path in the Parent Directory field.
    2. Enter the name of the cloned repository in the Clone Name field.
    3. Select the checkout branch in Checkout Branch.
    4. Verify the Remote Name of the checkout branch.
  7. Click Finish.

Using Git in Oracle JDeveloper

Using the Git extension, you can perform various Git actions such as cloning a Git repository, checking out and updating files, committing and pushing, and creating and merging branches.

Watch a short video to learn more about using Git in Oracle JDeveloper.

You can download the Git extension from the Help menu. Open the Help menu and select Check for Updates. See the JDeveloper documentation for more information.

For more information about Git actions in JDeveloper, read the Versioning Applications with Source Control chapter of Oracle Fusion Middleware Developing Applications with Oracle JDeveloper on http://docs.oracle.com/middleware.

Updating Oracle Developer Cloud Service Issues in JDeveloper

When you open a project in the Oracle Developer Cloud Service team server, the Tasks window displays the default issue search queries.

The issue queries include:

  • All tasks

  • Assigned to me

  • Open tasks

  • Related to me

  • User defined custom queries

Click the issue query link to open the query result in the Tasks window. If the Tasks window is not visible, open it from the Window menu.

In the Tasks window, double-click the issue to open it in the Task editor. Make your edits, and then click Submit to push the updates to Oracle Developer Cloud Service issue repository.

Create an Oracle Developer Cloud Service Issue

You can create an Oracle Developer Cloud Service task from the Tasks window.

To create an issue in the Tasks window of JDeveloper:
  1. In the Tasks window, click the Create New Task icon.
  2. In the Report a New Task editor, enter the issue details (see Creating an Issue).

    Click Submit Issue to push the issue details and create the issue in Oracle Developer Cloud Service. The submitted issue is now available in the web interface of Oracle Developer Cloud Service.

    Tip:

    You may also create an issue from the Team menu. Open the Team menu and select Report Task, in Task Repository select the project for which you want to create the issue, enter the details, and click Submit Issue.

Create an Oracle Developer Cloud Service Issue Query in JDeveloper

You can create an Oracle Developer Cloud Service issue query from the Tasks window.

To create an issue query in JDeveloper:
  1. In the Tasks window, click the Create New Query icon in the header of your project.
  2. In the Find Tasks editor, specify the search criteria and click Search.
  3. To save the search query, click Save Query.
    Tasks matching the search query are displayed in the bottom pane of the Find Tasks editor.
  4. Enter a unique name in the Save Query dialog and click Save.
The saved query is also available in the web interface of Oracle Developer Cloud Service.

Tip:

You may also create an issue query from the Team menu. Open the Team menu and select Find Tasks. In Task Repository, select the project for which you want to create the issue query, enter the criteria, and click Search.

Associating an Issue with a Commit

You can associate an issue and update it in Oracle Developer Cloud Service when you commit files.

To associate an issue with a commit:
  1. From the Tasks window, open the issue that you want to associate with the commit.
  2. Update the issue and click Submit.
  3. Commit files.
  4. In the Task Repository field of the Commit dialog, if necessary, select the Oracle Developer Cloud Service project.
  5. Select the issue from the Task list.
    Only those issues that you have opened and updated appear in the Task list.
  6. Select the desired check boxes and option buttons.
  7. Click OK.
The issue is updated in the Issues tab. Open the issue in Oracle Developer Cloud Service web interface and verify that the SHA-1 checksum hash of the commit is also added to Commits in Associations

Monitoring Project Builds in JDeveloper

When you open a project in the Oracle Developer Cloud Service team window, it displays all builds and jobs of the project along with their status.

To view a particular build's details, double-click the job name in the Team window to view its builds in the Oracle Developer Cloud Service web interface.

Building Oracle ADF Applications with Oracle Developer Cloud Service

You can develop Oracle ADF applications in JDeveloper and then build them using OJMake and OJDeploy tools with Ant or Maven in Oracle Developer Cloud Service.

Building with Ant

Tutorial icon Tutorial

To build an Oracle ADF application using Ant in Oracle Developer Cloud Service:

  1. Create an Oracle ADF application in Oracle JDeveloper.

  2. Add or configure the build.properties and build.xml files.

    • In build.xml, add <property environment="env"/> immediately after the <project> element to enable Ant to access the system environment variables and store them in properties, prefixed with env.

      Example:

      <?xml version="1.0" encoding="windows-1252" ?>
      <project name="HelloWorldADFProject" basedir=".">
        <property environment="env" />
        <property file="build.properties"/>
        ...
      </project>
      

      Configure build.properties file to use Oracle Developer Cloud Service build executor environment variables to access the ant library, the OJDeploy tool, and the JDeveloper directory installed on the Oracle Developer Cloud Service build executor. See About the Build Executor Environment Variables.

  3. Commit and push the application to the hosted Git repository.

  4. In Oracle Developer Cloud Service, create and configure a job with an Ant build step.

  5. Run a build of the job to generate the artifacts.

Using OJServer with OJDeploy

When you run a job configured to use multiple OJDeploy builds, the build starts, runs, and then shuts down JDeveloper ojdeploy for each invocation. You can increase the OJDeploy performance by using OJServer, which eliminates the requirement to start and stop OJDeploy after each invocation.

To use OJServer with OJDeploy, you must configure the job and update the Ant script to use OJServer.

  1. Configure the build.xml file of your application to add the ojserver argument (<arg value="-ojserver"/>) before parameters are defined.

    Example:

    <property file="build.properties"/>
      <target name="deploy" description="Deploy JDeveloper profiles">
        <taskdef name="ojdeploy" 
                 classname="oracle.jdeveloper.deploy.ant.OJDeployAntTask"
                 uri="oraclelib:OJDeployAntTask"
                 classpath="${oracle.jdeveloper.ant.library}"/>
        <ora:ojdeploy xmlns:ora="oraclelib:OJDeployAntTask"
                      executable="${oracle.jdeveloper.ojdeploy.path}"
                      ora:buildscript="${oracle.jdeveloper.deploy.dir}/ojdeploy-build.xml"
                      ora:statuslog="${oracle.jdeveloper.deploy.dir}/ojdeploy-statuslog.xml">
          <arg value="-ojserver"/>
          <ora:deploy>
            <ora:parameter name="workspace" value="${oracle.jdeveloper.workspace.path}"/>
            <ora:parameter name="profile" value="${oracle.jdeveloper.deploy.profile.name}"/>
    		</ora:deploy>
    	</ora:ojdeploy>
  2. In Oracle Developer Cloud Service web interface, configure the job to run a Shell build step that starts OJServer before running OJDeploy commands.

    Add a Shell build step to ojserver.

    Examples:

    $ORACLE_HOME_SOA_12_1_3/jdev/bin/ojserver -start &

    $ORACLE_HOME_SOA_12_2_1/jdev/bin/ojserver -start &

    See Adding a Build Step that Runs a Shell Script.

    Note:

    • In the command that invokes ojserver, the & character is required at the end of the command to keep ojserver running in the background. In the command, use the correct environment variables that matches your JDeveloper 12c or above version. OJServer is not supported in JDeveloper 11g. For more information about environment variables, see About the Build Executor Environment Variables.

    • In the Shell build step that starts the ojserver, use the sleep command to add a 30 seconds or more wait time to allow the ojserver process to start before any other command runs.

      Example:

      $ORACLE_HOME_SOA_12_1_3/jdev/bin/ojserver -start &

      sleep 30

    • Configure the job to use JDK 8 (or above) as JDev 12.2.1 and above versions do not support JDK 7 (or lower).

  3. ojserver process automatically stops with any other remaining processes when the build executor is recycled/cleaned up for the next users job.

Building with Maven

Tutorial icon Tutorial

You can configure the Maven POM file to access the Oracle Maven Repository to access JDeveloper and ADF libraries. You would also need Oracle SSO credentials to access the Oracle Maven repository.

To build an Oracle ADF application using Maven and Oracle Maven Repository in Oracle Developer Cloud Service:

  1. Create an Oracle ADF application in Oracle JDeveloper.

  2. Add and configure the Maven POM file of the ADF application. Use Oracle Developer Cloud Service build executor environment variables to access the OJMake and OJDeploy tools on the Oracle Developer Cloud Service build executor and the Oracle Maven Repository. See About the Build Executor Environment Variables.

  3. Commit and push the application to the hosted Git repository.

  4. In Oracle Developer Cloud Service, create and configure a job with a Maven build step.

    See Using the Oracle Maven Repository and Configuring Build Steps.

  5. Run a build of the job to generate the artifacts.