Best Practices from Oracle Development's A‑Team

Jumpstarting Development on the Cloud - Part 2 : Packaging and Build


The Oracle Developer Cloud Service (DevCS) 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 on, and deploy applications within Oracle Cloud. Some of the core features offered by DevCS include a hosted GIT repository, a Maven repository, Issue Tracking capabilities, a Hudson Continuous Integration (CI) server, Wiki collaboration, code-review, roles and responsibilities separation, and many more. The complete list of features is available here.

While the documentation of all these features is available at http://docs.oracle.com/cloud/latest/devcs_common/index.html , in this blog we'll concentrate on the Maven aspect of DevCS. Specifically, we'll describe how one can :

Developer Cloud Service lets you create a number of 'projects'. With each project, an instance of Hudson CI Server, a GIT repository, a Maven Repository and a Wiki server are allotted. Below is a snapshot of the DevCS project home page:

The environment specific data has been redacted from the images in this blog.


It can be seen above that there are two git repositories attached to the project. DevCS allows a number of GIT repositories, both hosted and external, to be attached to a project. This provides flexibility to the Project Management team within your organization to logically separate projects as needed. The GIT Repositories can be managed via the Admin tab, where the result is shown below :

Populating the Maven Repository

In this section we will go through the steps to populate the DevCS Maven repository with the Weblogic 12.1.2 libraries, although the steps are valid for any version of Weblogic 12c.

Since the Weblogic libraries are Oracle copyrighted, care must be taken to ensure the libraries aren't publicly accessible. Since a DevCS Maven repository is protected via HTTP Authentication, it's OK to upload the libraries there.

The entire process can be divided into three main steps :

  1. Setting up Maven on a local machine.

  2. Installing Weblogic binaries on the local machine.

  3. Pushing the local binaries to the remote Maven repository.

Before starting the upload, it is important to consider the network latency and upload speed to ensure the upload happens as quickly as possible.
Also, if a large number of libraries are to be uploaded, it is worth considering a VNC type session, so that session interruptions do not interfere with the upload.

1. Setting up Maven on the local Machine

  1. Download and install the apache-maven-3.x.x (we used 3.0.5) on the local Machine (say a linux VM).

  2. Open MVN_HOME/conf/settings.xml and make the following changes.

    1. Under the ‘proxies’ section, specify the appropriate proxy, as given below:

    2. Under the ‘servers’ section, specify a remote Maven server called remoteRepository. This will hold the username/password details when connecting to the ‘remoteRepository’, i.e. our DevCS Maven Repository :

    3. The DevCS Maven Repository is protected, and only users who have access to the project can view the associated repository. The authentication mechanism is basic HTTP. The username/password above will be used for authentication before the upload.

    4. Under the ‘profiles’ section, specify the default value of ‘remoteRepository’, as mentioned below:

    5. <profiles>
                            <name>Remote Weblogic Repository</name>

      The 'url' above can be found on the DevCS home page, as seen in the above image. Also note the 'dav:' in the URL, signifying that the upload will use the WebDAV protocol.

    6. Make sure the default profile is activated :


b) Installing Weblogic binaries on the local machine

  1. Download the Weblogic 12.1.2 'Zip distribution for Mac OSX, Windows, and Linux’ from Oracle Technology Downloads . We used the zip distribution only for demonstration purposes, any other type of installation would work as well.

  2. Unzip the downloaded file to any location (eg: /home/myhome/mywls ).

  3. Set JAVA_HOME and MW_HOME, eg :

    1. $export JAVA_HOME=/home/myhome/myjavahome

    2. $export MW_HOME=/home/myhome/mywls/wls12120

  4. Run MW_HOME/configure.sh . This unpacks all the jar files

c) Pushing the local weblogic binaries to the remote maven repository

  1. On the local VM, ensure MVN_HOME/bin is available in the $PATH variable

  2. ‘cd’ to location ‘/home/myhome/mywls/wls12120/oracle_common/plugins/maven/com/oracle/maven/oracle-maven-sync/12.1.2’

  3. Create a file, pom.xml , with the following content :

            <!--The version, groupId, artifactId above can be anything. -->

    The above pom.xml declares the wagon webdav plugin to be part of the mvn context. This library is used for uploading content to the remote repository using the WebDAV protocol.

  4. Run the command :

    mvn deploy:deploy-file -DpomFile=oracle-maven-sync.12.1.2.pom -Dfile=oracle-maven-sync.12.1.2.jar  -DrepositoryId=remoteRepository   -X  -Durl=dav:https://developer.us2.oraclecloud.com/……/maven/
  5. This populates the local Maven repository, and deploys the file oracle-maven-sync.12.1.2.jar, its associated pom, and the MD5 and SHA1 hash of each to the remote repository specified by the -Durl parameter. The -DrepositoryId is used to pick up the authentication information from settings.xml (which we set above in Section a.2).

  6. Run the command :

    mvn com.oracle.maven:oracle-maven-sync:push -Doracle-maven-sync.oracleHome=/home/myhome/mywls/wls12120 -Doracle-maven-sync.serverId=remoteRepository
  7. This command invokes the 'Oracle Maven Synchronization Plugin', specifically the coordinate com.oracle.maven:oracle-maven-sync:push , which uploads the local weblogic jars to the remote repository. This command recursively traverses through various dependencies and uploads them all. Depending on the network connection/upload speed, this may take a couple of hours.

  8. Please note that this command uses the pom.xml file defined in step#iii above.

Use Maven to compile, package and deploy a java application to JCS-SX

We assume that the source java project is checked into the DevCS GIT repository.
The following pom.xml can be used for compiling and packaging the project. It must also be checked into the GIT repository.

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

The things to note are :

  • The com.oracle.weblogic and junit dependencies

  • Maven compiler plugin which lets us specify the -source and -target options while using javac (optional)

  • Maven Repository url that specifies the location of the Weblogic libraries (i.e. the repository we just populated)

Below are the steps for setting up the Hudson build and deployment options on DevCS:

  1. On the DevCS project home page, click on the 'Build' tab, and create a new job

  2. Name the new job. On the configurations page, set the following :

    1. JDK Version

    2. Git Repository details

    3. Create a Maven 3 Build Step and specify 'clean package' as the goals. Also ensure the pom.xml file is specified correctly.

    4. In the post-build step check the 'Arhive the artifacts' option, specifying the file(s) to be archived, as shown below . The archived file(s) will be used to deploy the generated artifacts to the associated JCS-SX instance.

    5. Save the job. Run it once to make sure the build executes successfully

  3. Go to the 'Deploy' tab and create a new Deployment Configuration :

  4. The options in the image above are self-explanatory. The application ‘TestConfiguration’ is to be deployed to the JCS-SX instance ‘jcssx02′. The artifacts generated from the specific Hudson job and build number are deployed to the 'jcssx02' instance. One can also schedule an Automatic deployment (as compared to ‘On Demand’) on every successful Hudson build.


We've demonstrated how to use the Developer Cloud Service to automate your Maven based development lifecycle. We saw how the Maven Repository can be populated with weblogic or other custom jars, and how the Hudson build jobs and deployments can be configured.

We'd be remiss if we didn't mention the newly introduced Oracle Maven Repository . Steve Button explains it nicely in his blog https://blogs.oracle.com/WebLogicServer/entry/weblogic_server_and_the_oracle . Efforts are underway to make the Oracle Maven Repository work with DevCS. More on that when we have more information.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha