#### Creating a JReport Server WAR/EAR

JReport Server provides a tool for building a WAR or EAR file. The tool is makewar.bat/makewar.sh, and makewar.xml in `<install_root>\bin`.

##### makewar.xml

This file can be used to specify the following:

- Targets specified to build the WAR/EAR file. They start with the tag `<target name="xxx"...>`. You can modify the target names. By default, the main targets in the makewar.xml are as follows:
  - Making the server runtime environment
  - Making the WAR file for normal or remote integration
  - Making the EAR file
- Temp directories.
  - The temp directory used to save the temp files when building the WAR/EAR. By default, it is `<install_root>\bin\distribute\temp`.
  - The directory which is used to store the generated WAR/EAR file. By default, it is `<install_root>\bin\distribute`.
- The deployment descriptors, such as web.xml and application.xml. The configuration information, such as the database connection information for the WAR/EAR file is stored in these files.

##### makewar.bat/makewar.sh

The batch/script file used to build a JReport Server WAR/EAR according to the target specified in makewar.xml.

Usage

`makewar.bat/makewar.sh [Target Name] [-Dpredeploy=ReportFolder] [-Dreporthome=XXX] [-Djrs.remote.host=XXX] [-Djrs.remote.rmiport=XXX] [-Djrs.rmi.auth_file=XXX]`

Options

- Target Name
  The following targets can be performed:
  - buildWar - Specifies to build the JReport Server WAR. It is the default target.
  - buildEar - Specifies to build the JReport Server EAR.
  - buildRemoteWar - Specifies to build the JReport Server WAR for remote integration.
- -Dpredeploy=ReportFolder
  Allows you to deploy the reports and catalogs under ReportFolder to the WAR/EAR file.
- -Dreporthome
  Specifies the reporthome that will be set into web.xml in the WAR/EAR. If this argument is not set, reporthome will be decided when the WAR/EAR is loaded by the application server and the location will be `%user.home%/.jreport/default`. This argument takes effect only when the target name is buildWar, buildEar, or buildWar4WS.
- -Djrs.remote.host
  Specifies the server's RMI host when building a WAR for remote integration. This argument takes effect only when the target name is buildRemoteWar.
- -Djrs.remote.rmiport
  Specifies the server's RMI port when building a WAR for remote integration. This argument takes effect only when the target name is buildRemoteWar.
- -Djrs.rmi.auth_file
  Specifies the RMI auth file with the absolute file path when building a WAR for remote integration. This argument takes effect only when the target name is buildRemoteWar.

Examples

- Builds the JReport Server WAR file which is defined by makewar.xml (the default target). The generated WAR file is saved to the default directory`<install_root>\bin\distribute`.

  `makewar.bat`

- Builds the JReport Server WAR file, and saves the generated WAR file jreport.war to the default directory`<install_root>\bin\distribute`. When deploying the jreport.war to an application server, the report home will use `C:\JReport`.

  `makewar.bat buildWar -Dreporthome=C:\JReport`

- Builds the JReport Server EAR file, and saves the generated EAR file jreport.ear to the default directory `<install_root>\bin\distribute`.

  `makewar.bat buildEar`

- Builds the JReport Server WAR file, and deploys the reports and catalogs in `C:\myReport` to the WAR file. The generated WAR file jreport.war will be saved in the default directory `<install_root>\bin\distribute`.

  `makewar.bat buildWar -Dpredeploy=c:\myReport`

- Builds the JReport Server WAR file as defined by makewar.xml for remote integration. The generated WAR file is saved to the default directory`<install_root>\bin\distribute`.

  `makewar.bat buildRemoteWar -Djrs.remote.host=127.0.0.1 -Djrs.remote.rmiport=1129 -Djrs.rmi.auth_file=C:\JReport\Server\bin\rmi.auth`