Oracle Java Cloud Service - SaaS Extension

All the productivity of Java, without the IT.

Maven Plug-in

The Maven Plug-in JAR

The Maven plug-in is available for most of the command-line interface (CLI) commands. Each command is exposed as a Maven goal. The plug-in JAR is maven-javacloud.jar and it is bundled in the SDK. Each Maven goal supports all of its corresponding CLI command arguments as properties. In addition to those properties, they also support corresponding ant-tasks additional attributes.

Note that failonerror is false by default. You can either pass this property with the value of true -Dfailonerror=true, or if you want the Maven build to fail when a goal fails, put it in your pom.xml.

Note: Goals do not require a project. For example, install goal can be executed directly on the command line to deploy a WAR that is a generated by Ant.

Installing the Maven Plug-in

To install the Maven plug-in, follow these steps:

  • Unzip the SDK and set the SDK_HOME environment variable to point to the unzipped directory.
    For example: export SDK_HOME=/Users/javacloud-user/Desktop/work/sdk/oracle-javacloud-sdk
  • mvn install:install-file -Dfile=$SDK_HOME/lib/maven-javacloud.jar -DpomFile=$SDK_HOME/doc/resources/javacloud.pom

The steps above install the plug-in into your local repository.

Building and Installing the Maven Samples from the SDK

To build and run the Maven samples, follow the above steps and then:

  • cd $SDK_HOME/samples/maven/mvn-logger
  • Update the pom.xml with the correct property values. You can also pass these properties on the command line.
    For example: -Duser=myusername
    • <local>false<local>
    • <adminurl>adminurl</adminurl> Note: adminurl must be specified when local=true. When local=false, either datacenter(default value is us1) or adminurl has to be specified.
    • <user>user</user>
    • <identitydomain>id</identitydomain>
    • <serviceinstance>si</serviceinstance>
  • mvn install -DSDK_HOME=$SDK_HOME -Dpassword=pwd

Use -Dlocal=true and -Dclasspath=<path to weblogic.jar> when you are deploying to a local Weblogic domain

How to Use as the CLI Without a Maven Project?

You can execute it from any directory. The following command lists all recent jobs:

  • mvn -DSDK_HOME=$SDK_HOME -Duser=user -Dpassword=pwd -Didentitydomain=id -Dserviceinstance=si -Dgrid=true

Maven goals and corresponding CLI commands
Goal Corresponding CLI Command install delete update start stop job-status list-jobs list-job-logs job-log-file list-applications describe-application list-service-instances describe-service-instance restart-service-instance query-service-logs query-service-metrics describe-credential set-credential delete-credential reset-ssl-certificate-store list-ssl-certificates add-ssl-certificates delete-ssl-certificates download-ssl-certificates reset-wss-certificate-store list-wss-certificates add-wss-certificates delete-wss-certificates download-wss-certificates fs-shell config-shell list-commands list-service-metrics list-config set-config