#### Creating a JReport Enterprise Server WAR/EAR

JReport Enterprise 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:

- Tasks specified to build the WAR/EAR file. The task name starts with the tag `<target name="xxx"...>`. You can modify the task names. By default, the main tasks in the makewar.xml are as follows:
  - Making the server runtime environment
  - Making the WAR file
  - 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 Enterprise Server WAR/EAR according to the task specified in makewar.xml.

Usage

`makewar.bat/makewar.sh [-Dpredeploy=ReportFolder] [Task Name]`

Options

- -Dpredeploy=ReportFolder: Allows you to deploy the report sets and catalogs under ReportFolder to the WAR/EAR file.
- Task Name: Specifies whether to build the JReport Enterprise Server WAR or EAR. It can be buildWar or buildEar.

Examples

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

  `makewar.bat`

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

  `makewar.bat buildWar`

- Builds the JReport Enterprise 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 Enterprise Server EAR file, and deploys the report sets 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 -Dpredeploy=c:\myReport buildWar`