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 com.oracle.cloud:javacloud:list-jobs

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