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.
If you want to change the name of an .ear file that already has been deployed, you must undeploy it before changing its name.
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.
Filenames can contain only alphanumeric characters, hyphens, and underscores. Spaces are not allowed.
In the NetBeans Project window, right-click the Deployment Profile to display its context menu.
Select Properties to display the Deployment Properties dialog.
Clear the check box for Use default EAR file name (it is checked by default).
Enter the name you want into the EAR file text box, and click OK.
Locate the following file, and select Edit from its context menu:
<CAPS_install_dir>\commandlinecodegen\ant.bat |
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 |
Save the file.
Locate the following file, and open it in a text editor:
<CAPS_install_dir>/commandlinecodegen/ant |
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’ |
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’ |
Save the file.