Search This Blog

Ojdeploy ADF Build Utility with out open Jdevloper create EAR using CMD and Ant Scripts

Ojdeploy ADF Build Utility with out open Jdevloper create EAR using CMD and Ant Scripts


Normally in Production Env using ant scripts Admin will deploy the code . But before deploy the code using Ant Script . we need EAR files in Application deploy folder.

If you are committing code in SVN with EAR file is not a good practice. In Prod server most of the things done using scripts. If I open Jdeveloper in prod server un necessarily I am wasting server memory . How to over this problem ?


Solution :  

Oracle came up with solution using Ojdeploy ADF Build Utility 




C:\Oracle\Middleware\Jdev11\jdeveloper\jdev\bin>ojdeploy -workspace c:\JDeveloper\mywork\DemoApplicationTWo\DemoApplicationTWo.jws -profile  DemoAppli

cationTWo_application1
  


  Explanation:

ojdeploy              - utility Name 
workspace          -  Workspace location
profile                 -  Name of the EAR  create


-------------------------------------------------------------------------------------------------------------------

Deploy using ANT Scripts with the help of OJdeploy Utility :


Select view Controller Project --> New --> Ant --> Build File from  Project



 

 check  ( Include  Packaging  Tasks Use ojdeploy )


 Buil.xml and Build.Properties create under Resource Folder

Inside Build.xml ojdeploy option included


  <target name="deploy" description="Deploy JDeveloper profiles" depends="init">
    <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="project"
                       value="${oracle.jdeveloper.project.name}"/>
        <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>




 Note : Remove Yellow shaded line from build.xml

Happy codding :-)

No comments:

Post a Comment