Friday, 18 May 2018

Building ADF applications using Developer cloud service

In this post I will be demonstrating the steps required to build ADF applications using Oracle Developer Cloud Service. I will be using ant to do the build activity, the steps are more or less same even if you are planning to use maven.

  • Create a project and repository in developer cloud service.
  • Check-in all your project code to GIT repository of developer cloud service.
  • Generate the build files (build.xml and build.properties) if not present in your project.
  • Jdeveloper generated build files will work when build in your local environment, when you need to build it in developer cloud service, you need to tweak the files a bit. 
build.properties file

oracle.commons=../../../../oracle_common/
install.dir=../../../..
oracle.home=${env.ORACLE_HOME_12C3}
oracle.jdeveloper.workspace.path=${env.WORKSPACE}/SampleBuildApp.jws
middleware.home=${env.MIDDLEWARE_HOME_12C3}
workspace=${env.WORKSPACE}
oracle.jdeveloper.ant.library=${env.ORACLE_HOME_12C3}/jdev/lib/ant-jdeveloper.jar
oracle.jdeveloper.deploy.dir=${env.WORKSPACE}/ViewController/deploy
oracle.jdeveloper.ojdeploy.path=${oracle.home}/jdev/bin/ojdeploy
javac.nowarn=off
oracle.jdeveloper.project.name=ViewController
oracle.jdeveloper.deploy.outputfile=${env.WORKSPACE}/deploy/${profile.name}
output.dir=classes
javac.deprecation=off
oracle.jdeveloper.deploy.profile.name=*
javac.debug=on

  • Change SampleBuildApp.jws to your application name.
build.xml file

<?xml version="1.0" encoding="windows-1252" ?>

<project xmlns="antlib:org.apache.tools.ant" name="SampleBuildApp" basedir=".">
  <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>
</project>

  • Don't forget to add the property environment (highlighted in red).
  • Check-in these files to developer cloud service.
  • Create a new build job by selecting the application git repository as source and deploy as build task and in the post build steps select Archive the artifact option and enter deploy/*.ear in files to archive field.
.

  • Run the build operation by clicking build now button.
  • Once the build is completed, you can find the .ear file under deploy folder of artifacts.

  • You can take this file and deploy in you JCS or on-premises environment.

No comments:

Post a Comment