Using NetBeans IDE to Create an Oracle Developer Cloud Service Project


Options



Before You Begin

Purpose

In this tutorial, you'll learn how to create a project and work with Git repositories using Oracle Developer Cloud Service and NetBeans IDE.

Time to Complete

Approximately 30 minutes

Background

This tutorial shows you how to create an Oracle Developer Cloud Service project using only NetBeans IDE. NetBeans IDE creates a project with an empty repository that does not use a template. If you want to create a non-empty project or use a template, use the Oracle Developer Cloud Service user interface as described in Creating an Oracle Developer Cloud Service Project.

Both Oracle Developer Cloud Service and NetBeans IDE use the term project, but the term has a different meaning in each tool. An Oracle Developer Cloud Service project is a set of modules that includes a code repository, an issues module, an Agile technology module, a review module, a wiki module, a deployment module, and others. A NetBeans IDE project consists of the source code and libraries that form a deployable application. You check the NetBeans IDE project into the Oracle Developer Cloud Service code repository.

Context

After completing this tutorial, you may want to move on to Managing Issues Using Oracle Developer Cloud Service.

What Do You Need?

  • A login to an Oracle Developer Cloud Service instance

  • One of the following supported browsers:

    • Chrome 48 or later (also for Android)
    • Firefox 38 or later
    • Internet Explorer 11 or 12
    • Safari 7 or 8 (Mac OS)
    • Safari Mobile 5 (iOS)
  • An installation of Oracle WebLogic Server 11g or 12c (12.1.3.0 or 12.2.1.0)

  • An installation of the Java EE bundle of NetBeans IDE 8.0 or higher, with Oracle WebLogic Server added to it (this tutorial uses NetBeans IDE 8.2)

  • Some experience developing applications in Java

  • Some familiarity with the Git source control system

Installing the Team Server Plugin for NetBeans IDE

If you have not already done so, install the Team Server plugin.

  1. Start NetBeans IDE. From the Tools menu, select Plugins.

    Plugins menu item
    Description of this image
  2. Click the Available Plugins tab and enter cloud in the Search field.

    Searching for plugin
    Description of this image
  3. From the list that appears, select the Oracle Developer Cloud Service check box, and then click Install.

    Installing plugin
    Description of this image
  4. On the first screen of the installation wizard, click Next.

    First page of plugin installer
    Description of this image
  5. On the next screen, select the check box to accept all the license agreements and click Install.

    Accepting license agreements
    Description of this image

    Validating the plugins may take some time.

    Validating plugins
    Description of this image
  6. If a Verify Certificate screen appears, click Continue.

    Accepting license agreements
    Description of this image
  7. Click Finish when the installation is complete. Finally, click Close to close the Plugins window.

    Last page of plugin installer
    Description of this image

Adding the Team Server for Your Oracle Cloud Developer Service Instance to Your NetBeans IDE Instance

  1. In NetBeans IDE, from the Team menu, select Team Server, and then select Add Team Server.

    Add Team Server menu selection
    Description of this image
  2. Specify a name (for example, My Team Server) in the Name field, specify the URL of your Oracle Developer Cloud Service instance in the URL field, and then click OK. The URL includes both the service instance and the identity domain (http://myserviceinstance.oraclecloud.com/myidentitydomain).

    New Team Server dialog box
    Description of this image

    A Team tab opens.

    NetBeans IDE Team tab
    Description of this image
  3. Click Click here to select project, and then click Login.

    Logging in to Team Server
    Description of this image
  4. Enter your username and password, and then click Login.

    Specifying username and password
    Description of this image

    The team server appears in the Team tab.

    Projects in Team Server
    Description of this image
  5. (Optional) After you log in, NetBeans IDE synchronizes all issues, builds, and Git repositories of each project, and this may slow down NetBeans IDE performance. To synchronize the selected project only, click the Gear icon and select Auto Synchronize Services, and then select Selected Project Only.

Using the Team Server Plugin to Create an Oracle Developer Cloud Service Project

  1. Click the gear icon next to the Team Server name and select New Project from the menu.

    Selecting New Project in Team Server
    Description of this image
  2. On the Name and License page of the New Project on Oracle Developer Cloud Service wizard, enter a project name, such as My Web Application, in the Project Name field, and enter a description, such as Web application, in the Project Description field. In the Security area, select the Private option. Select Textile from the Wiki Markup drop-down list. Finally, click Next.

    Name and License page
    Description of this image
  3. On the Source Code and Issues page, click Browse next to the Local Repository Folder field.

    Browse button
    Description of this image
  4. In the Open dialog box, navigate to your NetBeansProjects folder or another location on the file system, enter my-web-application, and then click Open.

    Open dialog box
    Description of this image

    This naming convention ensures that the local repository folder will have the same name as the Oracle Developer Cloud Service repository on the server instance.

  5. Verify that the location is the one you intended, and then click Next.

    Source Code and Issues page
    Description of this image
  6. On the Summary page, verify that the information is correct, and then click Finish.

    Summary page
    Description of this image

    A progress bar is displayed while the project is being created. Finally, a dialog box reports that the project was successfully created. Click Close.

    Dialog box for created project
    Description of this image
  7. To verify that the project was created, launch your Oracle Developer Cloud Service instance, following the instructions in "Accessing Oracle Developer Cloud Service Using the Web Interface" in Using Oracle Developer Cloud Service.

  8. Provide your identity domain, user name, and password, and click Sign In. Then, from the My Services Dashboard, click Open Service Console for the Developer service.

  9. The project you created appears on the Welcome page. Click the project name.

    Welcome page with new project
    Description of this image

    On the Project page, you can see that the system created the empty hosted repository my-web-application.git.

    Home page with repository
    Description of this image
  10. On your file system, verify that the empty my-web-application project was created in your NetBeansProjects directory.

    Empty project directory with .git subdirectory
    Description of this image

Creating a Local Project Using NetBeans IDE

  1. In NetBeans IDE, from the File menu, select New Project to create a NetBeans IDE counterpart to your Oracle Developer Cloud Service project.

    New Project menu selection
    Description of this image
  2. On the Choose Project screen of the New Project wizard, select Java Web, then select Web Application, and then click Next.

    Choose Project screen of New Project wizard
    Description of this image
  3. In the Project Name field of what is now the New Web Application wizard, enter MyWebApp. Click Browse and specify the Project Location under the cloned my-web-application repository in your NetBeansProjects directory, then click Next.

    Name and Location screen of New Project wizard
    Description of this image
  4. Select Oracle WebLogic Server from the Server drop-down menu, or select Add... to add your Oracle WebLogic Server instance, then click Next. (This project uses Oracle WebLogic Server 12c. If you use Oracle WebLogic Server 11g, the Java EE version will be Java EE 5.)

    Server and Settings screen of New Project wizard
    Description of this image
  5. Select the JavaServer Faces check box in the Frameworks area. (If you are using Oracle WebLogic Server 11g, do not select any check box.) Click Finish.

    Frameworks screen of New Project wizard
    Description of this image

    The project is displayed in the Projects tab, and the index.xhtml file opens in an editor pane. Expand the MyWebApp and Web Pages nodes so that you can see the file in the project tree. (If you are using Oracle WebLogic Server 11g, the file will be index.jsp.)

    Project in Projects tab
    Description of this image
  6. In the XHTML file, change the line Hello from Facelets to Hello from the Cloud!, then click the Save icon or select Save from the File menu. (If you are using Oracle WebLogic Server 11g, change Hello World! to Hello from the Cloud!).

    Editing index.xhtml file
    Description of this image

From now on, the instructions assume you are using Oracle WebLogic Server 12c.

Pushing the NetBeans IDE Project to the Oracle Developer Cloud Service Git Repository

  1. In NetBeans IDE, return to the Team tab and expand Sources, then click the name of the project to return to the Projects tab. (If you don't see the project name, you may not have created the project under my-web-application.)

    Project under Team tab
    Description of this image
  2. In the Projects tab, right-click the project and select Git, then Commit.

    Committing project
    Description of this image
  3. In the Commit dialog, enter a commit message such as Initial commit of MyWebApp, and then click Commit to commit the project locally.

    Committing project files
    Description of this image
  4. A Set Repository User dialog box opens if your user name on the Oracle Developer Cloud Service instance is not identical to your user name on your local system. If the dialog box opens, click Yes.

    Set Repository User dialog box
    Description of this image
  5. Right-click the project and select Git, then Remote, then Push to Upstream.

    Push to Upstream menu selection
    Description of this image

    Because the repository on the server is empty, you need to create a master branch on the server and a local version of that branch.

  6. In the Create New Branch? dialog box, click Yes.

    Create New Branch dialog box
    Description of this image
  7. In the Set Up Remote Tracking? dialog box, click Yes.

    Set Up Remote Tracking dialog box
    Description of this image

    The project is now pushed to Oracle Developer Cloud Service.

  8. From the Team menu, select Repository, and then select Repository Browser to view the repository.

    Repository Browser menu selection
    Description of this image

    The Git Repository Browser window appears below the source code.

  9. In the Git Repository Browser window, expand the nodes to see the branches and remotes.

    Viewing Repository Browser
    Description of this image

Viewing the Modified Project in Oracle Developer Cloud Service

  1. Return to your Oracle Developer Cloud Service browser window and click the Project tab (even if you are already on that page) to view the Git commit in the activity feed. Notice the commit link (an SHA-1 checksum hash).

    Project Home page activity feed
    Description of this image
  2. To view the files that were committed, click the commit link.

    The Code page shows all the files that were added.

    Commit list in Code tab
    Description of this image
  3. Click the Code tab to go to the Files view, then click MyWebApp.

    Files view in Code tab
    Description of this image
  4. Click web to see the files in that directory, then click index.xhtml.

    Viewing files
    Description of this image
  5. Verify that the line you changed in NetBeans IDE is visible.

    Viewing a single file
    Description of this image

You can now make further changes to the project source code in NetBeans IDE, repeating the process of committing the changes locally and pushing them to the remote repository in your Oracle Developer Cloud Service instance.

If you want to log out of the NetBeans IDE Team Server, click the Team tab, click My Web Application, click the gear icon, and then click Logout.

Logging out of Team Server
Description of this image

If you wish, exit NetBeans IDE, and log out of your Oracle Developer Cloud Service instance.

Want to Learn More?