This document describes the supplied goals that are available when using the J2EE Plug-in with Maven.
Please refer to the Integration document for more information on how to integrate these goals into your project.
The build file utilizes various properties for default and user-configurable settings. All J2EE Plug-in properties are described in the Properties document. The rest of this document assumes your project follows the standard Directory Layout; however, it is possible to override many of these defaults.
| Goal | Description |
|---|---|
| j2ee:validate-war | Validate a WAR file. |
| j2ee:ejb | Creates an EJBjar file. |
| j2ee:ear | Creates an EAR file. |
The j2ee:validate-war target validates the newly
produced war file.
The validator checks the folowing:
<servlet> tag are loadable
from the war file and not the classpath<servlet> tag exist in the war
<taglib> have a
<taglib-location> that exists in the war<location> nested
within an <error-page> element must exist in the
war file<form-login-config
> element must exist in the war file
The j2ee:ejb target generates the ejb jar file
for the project. Optionally it can also create jars containing the local
and remote interfaces. The files are produced in the
${maven.build.dir}/ejb
directory and have a name based on the
${maven.j2ee.ejb.name}
property.
The files generated are:
${maven.j2ee.ejb.name}.jar${maven.j2ee.ejb.name}-remote.jar (optional)${maven.j2ee.ejb.name}-local.jar (optional)Maven also includes the license file, LICENSE.txt, if it exists, in the META-INF directory.
The contents of the ejb file include:
| Item | Description |
|---|---|
| ejb-jar.xml |
A J2EE enterprise bean deployment descriptor, which
is placed in the root of the resulting ear file.
The
${maven.j2ee.ejb.conf.dir} and associated includes and
excludes properties defines the location of this file.
|
| Classes |
The files in the ${maven.build.dest}
directory to be included is specified using the
${maven.j2ee.ejb.includes}
and ${maven.j2ee.ejb.excludes}
properties.
|
| Meta-Inf |
Files to be included the META-INF directory of the ejb
jar file may be specified using the
${maven.j2ee.ejb.conf.dir},
${maven.j2ee.ejb.conf.includes} and
${maven.j2ee.ejb.conf.excludes} properties.
|
The j2ee:ear target generates an ear file for the
project. The ear file is produced in the
${maven.build.dir}
directory and has a name defined by the
${maven.j2ee.ear.name}
property.
Maven also includes the license file, LICENSE.txt, if it exists, under the directory META-INF.
The contents of the ear file include:
| Item | Description |
|---|---|
| application.xml |
A J2EE enterprise application deployment descriptor, which
is placed in the META-INF of the resulting ear file.
The ${maven.j2ee.ear.appxml}
property defines the location of this file. It defaults to
src/application.xml
|
| Other Content |
Any dependencies specified in your project.xml
may be included by adding the ear.bundle.jar property to the
properties, e.g.
<dependency>
<id>CustomerEjb</id>
<version>2.4</version>
<properties>
<ear.bundle.jar>true</ear.bundle.jar>
</properties>
</dependency>
|