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.
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 |
You can configure the repository location using the command-line parameter commandline.rep.dir. The default value is localrepository.
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). |
Ensure there are no leading or trailing spaces in the values you enter for variables.
Set the JAVA_HOME environmental variable on your computer to the location where JDK version 1.5 is installed, for example:
set JAVA_HOME=c:\Program Files\Java\jdk1.5.0_14 |
Install Apache Ant, version 1.6 or later, on your computer. You can download this program from the following URL:
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 Java CAPS 6 Installation GUI
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 |
You must set this variable in the command window, in the directory in which you will be running the command.