Skip Navigation Links | |
Exit Print View | |
Deploying Oracle Java CAPS Projects Java CAPS Documentation |
1. Deploying Java CAPS Projects
To create a Deployment Profile
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)
Building an Application File From the Command Line
To Set up Your System to Use commandline codegen
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)
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)
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
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.
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:
You can specify the properties in the build.properties file.
You can specify the properties explicitly when issuing the command.
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
|
Note - Ensure there are no leading or trailing spaces in the values you enter for variables.
set JAVA_HOME=c:\Program Files\Java\jdk1.6.0_20
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.
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=
ant -propertyfile build.properties
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.
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=
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.
Note - The Export command works for ksh and bash. For csh, use setenv instead.
Export ANT_HOME=path Export JAVA_HOME=path dos2unix ant ant dos2unix build.xml build.xml dos2unix build.properties build.properties
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=
sh ant –propertyfile build.properties
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
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.
Export ANT_HOME=path Export JAVA_HOME=path dos2unix ant ant dos2unix build.xml build.xml dos2unix build.properties build.properties
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=
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.