JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Deploying Oracle Java CAPS Projects     Java CAPS Documentation
search filter icon
search icon

Document Information

1.  Deploying Java CAPS Projects

Creating a Deployment Profile

To create a Deployment Profile

Naming the Application File

To specify the filename of the EAR file in the NetBeans IDE

To specify the filename of the EAR file from the command line (Windows)

To specify the filename of the EAR file from the command line (AIX/LinuxSolaris)

Automapping

Mapping Variables

Version Control

Creating Snapshots

Retrieving Snapshots

Building an Application File

Building an Application File From the Command Line

To Set up Your System to Use commandline codegen

Windows Platform Procedures

To Build an Application File Based on a Property File Only (Windows)

To Build an Application File Using Command Line Parameters Only (Windows)

To Build an Application File Based on Both a Property File and Command Line Parameters (Windows)

UNIX Platform Procedures

To Build an Application File based on a Property File Only (AIX/Linux/Solaris)

To Build an Application File Using Command Line Parameters Only (AIX/Linux/Solaris)

To Build an Application File Based on Both a Property File and Command Line Parameters (AIX/Linux/Solaris)

Deploying Application Files from the NetBeans IDE

To Deploy an Application File from the NetBeans IDE

Deploying Application Files from Enterprise Manager

Adding the Application Server Domain to Enterprise Manager

To Add the Application Server Domain to Enterprise Manager

Deploying the Application File

To Deploy the Application File

Deploying Application Files from the Admin Console

To Deploy an Application File from the Admin Console

Deploying Application Files from the Command Line

Deploying from the asadmin Utility

Deploying from the asant Utility

Index

Building an Application File

The end product of the Project design process is an application file that can be deployed to an application server. This enterprise archive (.ear) file contains a collection of .jar files, classes, and resources. In the case of a web application, the corresponding web archive (.war) file contains a group of .jar files, classes, and resources that can be packaged and accessed as a single servlet context.

Once a Deployment Profile has been defined for your Project, you can build the .ear or .war file by clicking the Build button in the Deployment Editor toolbar. You can also generate an .ear file from the command line, without having NetBeans running.

The resulting .ear or .war file is stored in the following directory:

CAPS_install_dir\.netbeans\caps\builds\DeploymentNameProjectName\logicalhost\appserver

Note - By default, the .ear file does not contain the associated Java source files. For the Java source files to appear in the .ear file, you need to set the value of the NetBeans run.mode property to debug before building the file. You do this by setting a command-line switch in the following file:

CAPS_install_dir\netbeans\etc\netbeans.conf

Add “-J-Drun.mode=debug” to the series of entries following netbeans_default_options=. Note that the resulting .ear file can be quite large.


Building an Application File From the Command Line

You can generate an .ear file from the command line, without having the NetBeans IDE running, by using the commandline codegen tool, which you must download from the Repository using the Java CAPS Installer. When using this tool, you have three options for specifying the build properties for the .ear file:

  1. You can specify the properties in the build.properties file.

  2. You can specify the properties explicitly when issuing the command.

  3. You can specify properties globally in the build.properties file, and override them selectively by specifying those to be overridden when issuing the command.


Note - All relevant components must be saved in the NetBeans IDE prior to running commandline codegen.


By default, the resulting .ear file will be located in the following directory:

commandlinecodegen-install\localrepository\DEST\builds\ear-file\logicalhost\appserver

Note - You can configure the repository location using the command-line parameter commandline.rep.dir. The default value is localrepository.


Table 1-1 Commandline Codegen Properties

Property Name
Description
commandline.rep.url
Repository URL (required). The format is: http://host:port/repositoryname
commandline.rep.user
Repository user name (required).
commandline.rep.pass
Repository user password (required).
commandline.rep.dir
Repository root directory (required). The default value is localrepository.
commandline.rep.projectName
Project name (required).
commandline.rep.projectDeployName
Deployment Profile name (required).
commandline.rep.projectDeploymentTag
Project snapshot name (optional).
commandline.rep.projectBranchName
Repository Branch for the Project (optional).

Note - Ensure there are no leading or trailing spaces in the values you enter for variables.


To Set up Your System to Use commandline codegen

  1. Set the JAVA_HOME environmental variable on your computer to the location where JDK is installed, for example:
    set JAVA_HOME=c:\Program Files\Java\jdk1.6.0_20
  2. Install Apache Ant, version 1.6 or later, on your computer. You can download this program from the following URL:

    http://ant.apache.org/bindownload.cgi

  3. Log in to the Java CAPS Uploader, click the Downloads tab, and install commandline codegen. For additional information, see Installing Java CAPS Components Using the Java CAPS Uploader in Using the Oracle Java CAPS 6.3 Installation GUI
  4. At the command-line prompt, set the ANT_HOME environmental variable, for example:
    set ANT_HOME=c:\Program Files\Apache\apache-ant-1.6.5

    Note - You must set this variable in the command window, in the directory in which you will be running the command.


Windows Platform Procedures

To Build an Application File Based on a Property File Only (Windows)

  1. Locate the file build.properties in your commandlinecodegen directory.
  2. Open the file using a text editor such as Notepad. The contents are as follows:
    commandline.rep.url=http://host:port/repositoryname
    commandline.rep.user=
    commandline.rep.pass=
    commandline.rep.dir=localrepository
    commandline.rep.projectName=
    commandline.rep.projectDeployName=
    commandline.rep.projectDeploymentTag=
    commandline.rep.projectBranchName=
  3. Fill in the property values as described in Table 1-1 (optional properties may be left blank).
  4. Run commandline codegen by issuing the following command from the command-line prompt in your commandlinecodegen directory:
    ant -propertyfile build.properties

To Build an Application File Using Command Line Parameters Only (Windows)

To Build an Application File Based on Both a Property File and Command Line Parameters (Windows)

  1. Locate the file build.properties in your commandlinecodegen directory.
  2. Open the file using a text editor such as Notepad. The contents are as follows:
    commandline.rep.url=http://host:port/repositoryname
    commandline.rep.user=
    commandline.rep.pass=
    commandline.rep.dir=localrepository
    commandline.rep.projectName=
    commandline.rep.projectDeployName=
    commandline.rep.projectDeploymentTag=
    commandline.rep.projectBranchName=
  3. Fill in the property values as described in Table 1-1.
  4. Run commandline codegen by issuing the following command from the command-line prompt in your commandlinecodegen directory:
    ant -propertyfile build.properties "-D{propertyname1}={propertyvalue1}"
    "-D{propertyname2}={propertyvalue2}" … "-D{propertynameN}={propertyvalueN}"

    Note - When using a combination of a property file and command-line properties, the command-line properties override those specified in the property file. You need to list only those properties that you want to override.


UNIX Platform Procedures


Note - The Export command works for ksh and bash. For csh, use setenv instead.


To Build an Application File based on a Property File Only (AIX/Linux/Solaris)

  1. At the command prompt, run the commands:
    Export ANT_HOME=path
    Export JAVA_HOME=path
    dos2unix ant ant
    dos2unix build.xml build.xml
    dos2unix build.properties build.properties
  2. Locate the file build.properties in your commandlinecodegen directory.
  3. Open the file using a text editor. The contents are as follows:
    commandline.rep.url=http://host:port/repositoryname
    commandline.rep.user=
    commandline.rep.pass=
    commandline.rep.dir=localrepository
    commandline.rep.projectName=
    commandline.rep.projectDeployName=
    commandline.rep.projectDeploymentTag=
    commandline.rep.projectBranchName=
  4. Fill in the property values as described in Table 1-1 (optional properties may be left blank).
  5. Run commandline codegen by issuing the following command from the command-line prompt in your commandlinecodegen directory:
    sh ant –propertyfile build.properties

To Build an Application File Using Command Line Parameters Only (AIX/Linux/Solaris)

  1. At the command prompt, run the commands:

    At the command prompt, run the commands:

    Export ANT_HOME=path
    Export JAVA_HOME=path
    dos2unix ant ant
    dos2unix build.xml build.xml
    dos2unix build.properties build.properties
  2. Run commandline codegen by issuing the following command from the command prompt in your commandlinecodegen directory (see Table 1-1):
    sh ant "-D{propertyname1}={propertyvalue1}" "-D{propertyname2}=
    {propertyvalue2}" … "-D{propertynameN}={propertyvalueN}"

    Note - When using the command-line properties method, you must specify values for all required properties. You also may specify values for any optional properties as is appropriate.


To Build an Application File Based on Both a Property File and Command Line Parameters (AIX/Linux/Solaris)

  1. At the command prompt, run the commands:
    Export ANT_HOME=path
    Export JAVA_HOME=path
    dos2unix ant ant
    dos2unix build.xml build.xml
    dos2unix build.properties build.properties
  2. Locate the file build.properties in your commandlinecodegen directory.
  3. Open the file using a text editor such as Notepad. The contents are as follows:
    commandline.rep.url=http://host:port/repositoryname
    commandline.rep.user=
    commandline.rep.pass=
    commandline.rep.dir=localrepository
    commandline.rep.projectName=
    commandline.rep.projectDeployName=
    commandline.rep.projectDeploymentTag=
    commandline.rep.projectBranchName=
  4. Fill in the property values as described in Table 1-1.
  5. Run commandline codegen by issuing the following command from the command-line prompt in your commandlinecodegen directory:
    sh ant -propertyfile build.properties "-D{propertyname1}={propertyvalue1}"
     "-D{propertyname2}={propertyvalue2}" … "-D{propertynameN}={propertyvalueN}"

    When using a combination of a property file and command-line properties, the command-line properties override those specified in the property file. You need to list only those properties that you want to override.