Deploying Java CAPS Projects

Naming the Application File

You have the option of specifying the filename for the .ear file that is created from the Deployment Profile, which can make it easier to identify the file at a later time. By default, the .ear filename is a concatenation of the Deployment Profile name and the Project name. However, if the resulting name is too long or does not fit into your file-naming scheme, you can rename the file.

You can also name an .ear file from the command line, without having the NetBeans IDE running. See also Building an Application File From the Command Line.


Note –

If you want to change the name of an .ear file that already has been deployed, you must undeploy it before changing its name.



Note –

If you use the same custom .ear file name in multiple Deployment Profiles within the same Project and Environment, previously-built .ear files will be overwritten by more recently-built files, since custom .ear file names are stored in a common directory. In this situation, you must ensure that the file names you assign are unique.



Note –

Filenames can contain only alphanumeric characters, hyphens, and underscores. Spaces are not allowed.


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

  1. In the NetBeans Project window, right-click the Deployment Profile to display its context menu.

  2. Select Properties to display the Deployment Properties dialog.

    Image of Deployment Properties dialog box.
  3. Clear the check box for Use default EAR file name (it is checked by default).

  4. Enter the name you want into the EAR file text box, and click OK.

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

  1. Locate the following file, and select Edit from its context menu:


    <CAPS_install_dir>\commandlinecodegen\ant.bat
    
  2. Locate the line beginning with SET ANT_OPTS, and append the following entry:

    -Ddeployment.ear.file.name=filename

    where filename is the name you want for the .ear file; for example,


    SET ANT_OPTS=-Dantlrmaxaltblklines=3000 -Dcompile=injar -Xms512M -Xmx768m 
    -XX:PermSize=256m -XX:MaxPermSize=256m -Ddeployment.ear.file.name=test_ear
    
  3. Save the file.

ProcedureTo specify the filename of the EAR file from the command line (AIX/Linux/MacOS/Solaris)

  1. Locate the following file, and open it in a text editor:


    <CAPS_install_dir>/commandlinecodegen/ant
    
  2. Locate the following if-then-else statement:


    if [ "$UNAME_SYSTEM" = "AIX" ] || [ "$UNAME_SYSTEM" = "aix" ]; 
    then ANT_OPTS=’-Dantlrmaxaltblklines=3000 -Xms512M -Xmx768m’ 
    else ANT_OPTS=’-Dantlrmaxaltblklines=3000 -Xms512M -Xmx768m 
    -XX:PermSize=256m -XX:MaxPermSize=256m’
  3. Insert the following entry:


    -Ddeployment.ear.file.name=filename
    

    where filename is the name you want for the .ear file, as shown in the following example:


    if [ "$UNAME_SYSTEM" = "AIX" ] || [ "$UNAME_SYSTEM" = "aix" ]; 
    then ANT_OPTS=’-Dantlrmaxaltblklines=3000 -Xms512M -Xmx768m 
    -Ddeployment.ear.file.name=test_ear’ 
    else ANT_OPTS=’-Dantlrmaxaltblklines=3000 -Xms512M -Xmx768m -XX:PermSize=256m 
    -XX:MaxPermSize=256m -Ddeployment.ear.file.name=test_ear
  4. Save the file.