#### Integrating by building a JReport Enterprise Server EAR

The self-contained JReport Enterprise Server can be deployed as a single EAR file. After specifying the reporthome and configuring the database information, you can build the EAR file using the tool makewar.bat/makewar.sh in `<install_root>\bin`. To generate the EAR file, execute the command with the buildEar parameter, for example:

`makewar.bat/makewar.sh buildEar`

##### Structure of the JReport Enterprise Server EAR

For example, here you can create a JReport Enterprise Server EAR file named jreport.ear. The structure of the JReport Enterprise Server EAR is as below:

jreport.ear

META-INF/application.xml

jreport-lib/ -- This folder contains all resources in the JReport Enterprise Server library.

jreport.war

META-INF/MANIFEST.MF

WEB-INF/web.xml

admin/

jinfonet/

dhtmljsp/

##### META-INF/application.xml

Following the Java EE standard, you should configure the META-INF/application.xml file before deploying the EAR:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
    "http://java.sun.com/dtd/application_1_3.dtd">

    <application>
    <display-name>Self-contained JReport Enterprise Server</display-name>
    <module id="JReportWebModule">
    <web>
    <web-uri>jreport.war</web-uri>
    <context-root>jreport</context-root>
    </web>
    </module>
    </application>

##### META-INF/MANIFEST.MF of Web module

Since the JReport Enterprise Server library is included in jreport-lib of the EAR layer, you must specify Class-Path in the META-INF/MANIFEST.MF file. The contents below should be included in the MANIFEST.MF file:

`Class-Path: jreport-lib/jrenv.jar jreport-lib/JRESServlets.jar jreport-lib/JREngine.jar ...`

Class-Path is a list of all packages in the JReport Enterprise Server library. Each package name should start with the prefix jreport-lib/, and you should use a blank space to separate package names.

##### WEB-INF/web.xml of Web module

The contents in the web.xml of the JReport Enterprise Server EAR are the same as the contents in web.xml of the JReport Enterprise Server WAR. See the section Integrating by building a JReport Enterprise Server WAR for details.