Monday, December 5, 2011

OJDeploy: Documentation for the tool

Real DOCS:
OJDeploy Documentation if you run it from the command line - I keep looking for this so I though I would post it here so I remeber.

Oracle JDeveloper Deploy
Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.

  ojdeploy -profile <name> -workspace <jws> [ -project <name> ] [ <options> ]
  ojdeploy -buildfile <ojbuild.xml> [ <options> ]
  ojdeploy -buildfileschema

  -profile               the name of the Profile to deploy
  -workspace      full path to the JDeveloper Workspace file(.jws)
  -project              name of the JDeveloper Project within the .jws where the Profile can be found. If omitted, the Profile is assumed to be in the Workspace.
  -buildfile            full path to a build file for batch deploy
  -buildfileschema  print XML Schema for the build file

  -basedir          interpret path for workspace relative to a base directory
  -outputfile       substitute for the output file specified in the Profile.
  -nocompile        skip compilation of Project or Workspace
  -nodependents     do not deploy dependent profiles
  -clean            clean output directories before compiling
  -nodatasources    do not include datasources from IDE
  -forcerewrite     rewrite output file even if it is identical to existing file

  -updatewebxmlejbrefs                               update EJB references in web.xml
  -define                               define variables as comma separated name=value pairs
  -statuslogfile                    full path to an output file for status summary. No macros allowed.
  -failonwarning    stop deployment on warnings
  -timeout          time in seconds allowed for each deployment task
  -stdout           redirect stdout to file
  -stderr           redirect stderr to file
  -ojserver         run deployment using ojserver
  -address          listen address for ojserver

Built-in macros:    name of the workspace (without the .jws extension)
  workspace.dir     directory of the workspace.jws file      name of the project ( without the .jpr extension).
  project.dir       directory of the project.jpr file
  Note: and project.dir are only available when project-level
  profile is being deployed.      name of the profile being deployed
  deploy.dir        default deploy directory for the profile
  base.dir          current ojdeploy directory unless overridden by the –basedir  parameter  or by the "basedir" attribute in the build script

Deploy a Project-level profile
ojdeploy -profile webapp1 -workspace /usr/jdoe/Application1/Application1.jws -pr
oject Project1
ojdeploy -profile webapp1 -workspace Application1/Application1.jws -basedir /usr
/jdoe -project Project1

Deploy a Workspace-level profile
ojdeploy -profile earprofile1 -workspace /usr/jdoe/Application1/Application1.jws

Deploy all Profiles from all Projects of a Workspace
ojdeploy -workspace /usr/jdoe/Application1/Application1.jws -project \* -profile*/

Build in batch mode from a ojbuild file
ojdeploy -buildfile /usr/jdoe/ojbuild.xml

Build using ojbuild file, pass into, or override default variables in, the build
ojdeploy -buildfile /usr/jdoe/ojbuild.xml -define myhome=/usr/jdoe,mytmp=/tmp
ojdeploy -buildfile /usr/jdoe/ojbuild.xml -basedir /usr/jdoe

Build using ojbuild file, set or override parameters in the default section
ojdeploy -buildfile /usr/jdoe/ojbuild.xml -nocompile

ojdeploy -buildfile /usr/jdoe/ojbuild.xml -outputfile '${workspace.dir}/${}.jar'
ojdeploy -buildfile /usr/jdoe/ojbuild.xml -define mydir=/tmp -outputfile  '${mydir}/${}-${}'

More examples:
ojdeploy -workspace Application1/Application1.jws,Application2/Application2.jws -basedir /home/jdoe -profile app*
ojdeploy -buildfile /usr/jdoe/ojbuild.xml -define outdir=/tmp,rel=11.1.1 -outputfile ‘${outdir}/built/${}/${rel}/${}
ojdeploy -workspace Application1/Application1.jws -basedir /home/jdoe -nocompile
-outputfile '${base.dir}/${}-${}'
ojdeploy -workspace /usr/jdoe/Application1.jws -project \* -profile \* -stdout home/jdoe/stdout/${}.log

Oracle JDeveloper Audit (6081)
Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
Audit source files.

  ojaudit option... file...

  file                 Workspace, project, or source file to audit (required).

  -classpath           Set class path for files to audit (if no project).
  -encoding            Set character encoding for report.
  -disable rule*       Disable rule in profile.
  -enable rule*        Enable rule in profile.
  -fail severity       Set issue severity to regard as failure.
  -fix                 Apply default fixes (changes source code!).            -f

  -help                Print command help (this message) and exit.            -h

  -listall             List files with no issues in report.
  -maxfilesize size    Maximum file size, in Mb, to audit.
  -notitle             Set empty report title.
  -output file         Set report file name.                                  -o

  -profile name        Set profile to use (required).                         -p

  -profilehelp         Print defined profile names and exit.
  -project file        Set project for files to audit.
  -quiet               Suppress copyright message.                            -q

  -sourcepath          Set source path for files to audit (if no project).
  -rulehelp            Print available rules and exit.
  -role name           Set active JDeveloper customization role.
  -style file          Set XSLT style sheet to apply to report.               -s

  -stylehelp           Print defined style sheet names and exit.
  -title text          Set report title.
  -verbose             Print all messages.                                    -v

  -version             Print version and exit.
  -workspace file      Set workspace context for files to audit.              -w

  -workingset name     Set working set for files to audit within workspace(s).
  -workingsethelp      Print available working sets for a workspace and exit.
* Repeat option to supply multiple values.

  Output directed to standard output unless -output specified.
  -project/-sourcepath/-classpath required unless file is workspace or project.
  -workspace required if project depends on other projects in workspace.
  -profile/-style accept name or URL, ignore case, whitespace of name.
  -enable/-disable accept rule id or label, ignore case, whitespace of label.
  Default exit status does not reflect issues detected unless -fail specified.

  ojaudit -profile auditrules test.jpr
    Audits test.jpr using (predefined) Audit Rules profile.
  ojaudit -profile auditrules -project test.jpr src\mypackage\
    Audits in project test.jpr using Audit Rules profile.
  ojaudit -profile checkinrules.xml test.jpr
    Audits test.jpr using exported profile file checkinrules.xml.
  ojaudit -profile auditrules test.jpr -style audit-text
    Audits test.jpr and applies (predefined) audit-text stylesheet to output.
  ojaudit -profile auditrules test.jpr -output test.xml
    Audits test.jpr and directs output to test.xml.


  1. Hi,

    I am working with ojaudit but I need a way to use the tool with out any dependency on JDeveloper folder structure. Is that possible?
    Is there a stand-alone package for ojaudit?

    Thanks in advance,
    Arvinder Singh.

    Oracle Oracle Retail Global Business Unit

    ORACLE India | NR Enclave A Block, EPIP Industrial Area, White Field | 560066 Bangalore

    1. Not that I am aware of unfortunately the only way I can think of to try and do this is extract the ojdeploy classes and configuration files (ojaudit.conf, ojaudit.exe, ojaudit.boot) in the jdev folders and package and configure it yourself (NOTE: this is not easy as they load ide.conf and jdev.conf so it will be a lot of work)
      Some properties you may need to look at

      ojaudit.boot you will need to add the following
      SetJavaHome C:\Dev\jdk160_24_x64

      Alternatively you may want to audit your build with another audit tool like checkstyle etc.

    2. Thanks a lot Donovan for your reply.
      Although I have put in my time to try separate ojaudit from Jdev. But now I have got a confirmation from John 'JB' Brock who works a lot with JDeveloper Extension SDK.
      He says that ojaudit cannot be separated from the JDev installation folder.
      Please follow the following post :

  2. Also you can check and try modify what is happening in the linux shell file.