Tuesday Apr 28, 2015

Oracle Developer Cloud Service - Automating Builds for Oracle ADF Applications

Following up on the previous blog that showed how to get your ADF application into the Developer Cloud Service git repository, this entry will show you the next step in the lifecycle - executing builds.

The Oracle Developer Cloud Service (DevCS) supports build automation with both Maven and Ant scripts - and in this demo I'm showing you how to use the Ant option. One of the unique aspects of DevCS for customers who are  using Oracle ADF and JDeveloper is that the cloud comes pre-configured with the ADF libraries needed to compile your code, and also with support for OJDeploy so you can leverage deployment profiles that you defined for your application.

In fact DevCS comes with support for two ADF versions - 11.1.1.7.1 and 12.1.3 (as of the time of this blog).

In the video below you'll see

  • How to add a build file for your ADF application
  • How to  configure the build file to work in the cloud environment
  • How to define a build job and execute it
  • How to look at the log files for the build job
  • How to automate the build execution to happen when changes are committed to the git repository

The build in the example above just does the packaging, but in more realistic scenarios you can use similar build processes to create ADF libraries from projects, automate testing, modify configuration and more.

There are a couple of files that are used in the demo that you might want to use in your implementation:

The build.xml file: 

  <property environment="env" /> 
  <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">
      <ora:deploy>
        <ora:parameter name="workspace"
                       value="${oracle.jdeveloper.workspace.path}"/>
        <ora:parameter name="profile"
                       value="${oracle.jdeveloper.deploy.profile.name}"/>
        <ora:parameter name="nocompile" value="false"/>
        <ora:parameter name="outputfile"
                       value="${oracle.jdeveloper.deploy.outputfile}"/>
      </ora:deploy>
    </ora:ojdeploy>
  </target>

The build.properties file I used can be found here.

The mask for the build automatic execution is */1 * * * *

Note that in the properties file there are references to environment variables that you will need to change if you are looking to deploy an 11.1.1.* app - specifically the options for 12 and 11 are:

WLS_HOME_12C3=/opt/Oracle/Middleware12c3/wlserver
WLS_HOME_11G=/opt/Oracle/Middleware/wlserver_10.3
MIDDLEWARE_HOME_12C3=/opt/Oracle/Middleware12c3
MIDDLEWARE_HOME_11G=/opt/Oracle/Middleware
ORACLE_HOME_12C3=/opt/Oracle/Middleware12c3/jdeveloper
ORACLE_HOME_11G=/opt/Oracle/Middleware/jdeveloper

Tuesday Dec 27, 2011

CheckStyle Integration with JDeveloper through Ant External Tools

When developers switch from Eclipse to JDeveloper they sometime find that a plug-in that they were using in Eclipse is not available for JDeveloper. In many of the cases a plug-in is not really needed since the functionality is already built-in in JDeveloper. But still sometimes developers would like to get a plug-in they were used to.

Case in point, Checkstyle - an open source utility that audits your Java code according to rules you define for it. JDeveloper has a built in Audit framework with lots of rules that you can turn on or off, and you can also add new audit rules and checks. But what if you want to leverage Checkstyle instead?

One solution is to build an extension that will integrate the two, but for a quicker - and more basic - solution you could opt for the Tools->External Tools option. This option has been there for ages now and allows you to invoke command line interfaces and pass parameters. In recent versions two new options were added that allow you to integrate either Ant or Maven scripts as well.

In this demo I show how to integrate CheckStyle into JDeveloper using this simple Ant script:

<?xml version="1.0" encoding="windows-1252" ?>
<project xmlns="antlib:org.apache.tools.ant" name="Project1" default="all" basedir=".">
    <taskdef resource="checkstyletask.properties" classpath="checkstyle-5.5-all.jar"/>
    <target name="checkstyleAll">
        <checkstyle config="sun_checks.xml">
            <fileset dir="${dir}" includes="**/*.java"/>
        </checkstyle>
    </target>
    <target name="checkstyle">
        <checkstyle config="sun_checks.xml" file="${file}"></checkstyle>
    </target>
</project>

 Here are the steps:


About

me
I'm a Director of Product Management for the Oracle Mobile and Development Tools.
Follow me:
Search

Archives
« July 2015
SunMonTueWedThuFriSat
   
1
2
3
4
5
6
7
8
9
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
       
Today