Apache Maven 1.x has reached its end of life, and is no longer supported. For more information, see the announcement. Users are encouraged to migrate to the current version of Apache Maven.

Maven J2EE Plug-in Properties

The following is an overview of the various properties (and default values) used by the Maven J2EE Plug-in goals. These properties control various aspects of the J2EE build. Most of these properties are optional and have defaults; however, there are mandatory properties that must be set as described in this document.

These properties can be overridden to change the default behavior of the Maven J2EE Plug-in. If you need to override any of these properties, please refer to the Integration document for the preferred method of setting properties in your project.

SectionDescription
War These properties specify various settings that control the build of a war file by the J2EE Plug-in.
EJB These properties specify various settings that control the build of a ejb jar by the J2EE Plug-in.
Ear These properties specify various settings that control the build of an ear file by the J2EE Plug-in.

War Settings

PropertyOptional?Description
maven.j2ee.war.name No Specifies the name of the web application to be built.
maven.j2ee.war.src Yes Specifies the directory in the local file system that is used as the base directory for finding web applications. It defaults to ${maven.src.dir}/webapps
maven.j2ee.war.content Yes Specifies the directory in the local file system that holds web content to be placed in the war file. It defaults to ${maven.j2ee.war.src}/${maven.j2ee.war.name}
maven.j2ee.war.classes.includes Yes Specifies the pattern of files in the directory specified by ${maven.build.dest} to be included in the /WEB-INF/classes of the resulting war file. It defaults to **, that is, all files.
maven.j2ee.war.classes.excludes Yes Specifies the pattern of files in the directory specified by ${maven.build.dest} that are not to be included in the /WEB-INF/classes of the resulting war file. It defaults to **/package.html.
maven.j2ee.war.lib.includes Yes

WARNING: This property is temporarily unused.

Specifies the pattern of files in the project dependencies to be included in the /WEB-INF/lib of the resulting war file. It defaults to *.jar, that is, all dependencies.
maven.j2ee.war.lib.excludes Yes

WARNING: This property is temporarily unused.

Specifies the pattern of files in the project dependencies not to be included in the /WEB-INF/lib of the resulting war file. It defaults to blank, that is, no dependencies are excluded.
maven.j2ee.war.webxml Yes Specifies the deployment descriptor to be used when building the war file. It will be placed in /WEB-INF/web.xml of the resulting war file. It defaults to ${maven.conf.dir}/${maven.j2ee.war.name}-web.xml

EJB Settings

PropertyOptional?Description
maven.j2ee.ejb.name No Specifies the name of the ejb jar to be built.
maven.j2ee.ejb.conf.dir No Specifies the directory to be used to find the deployment descriptor and other files to be placed in META-INF directory of the resulting ejb jar. It defaults to ${maven.conf.dir}/${maven.j2ee.ejb.name}
maven.j2ee.ejb.conf.includes Yes Specifies the a pattern of files to be included in the META-INF directory of the resulting ejb jar, relative to the ${maven.j2ee.ejb.conf.dir}. It defaults to ejb-jar.xml.
maven.j2ee.ejb.conf.excludes Yes Specifies the a pattern of files to be excluded from the META-INF directory of the resulting ejb jar, relative to the ${maven.j2ee.ejb.conf.dir}. It defaults to blank.
maven.j2ee.ejb.includes Yes Specifies the pattern of files in the ${maven.build.dest} directory to be included in the generated ejb jar. Defaults to **/*.
maven.j2ee.ejb.excludes Yes Specifies the pattern of compiled class files to be excluded from the generated ejb jar. Defaults to **/package.html.
maven.j2ee.ejb.local.includes Yes If this property exists then a jar file with the name ${maven.j2ee.ejb.name}-local.jar containing the matching files will be generated in ${maven.build.dir}/ejb.
maven.j2ee.ejb.local.excludes Yes Files to be excluded from the ${maven.j2ee.ejb.name}-local.jar
maven.j2ee.ejb.remote.includes Yes If this property exists then a jar file with the name ${maven.j2ee.ejb.name}-remote.jar containing the matching files will be generated in ${maven.build.dir}/ejb.
maven.j2ee.ejb.remote.excludes Yes Files to be excluded from the ${maven.j2ee.ejb.name}-remote.jar

Ear Settings

PropertyOptional?Description
maven.j2ee.ear.name No Specifies the name of the enterprise application to be built.
maven.j2ee.ear.includes Yes Specifies the pattern of files in the ${maven.build.dir} directory to be included in the resulting ear file. It defaults to *.jar, *.war, that is, all jar and war files.
maven.j2ee.ear.excludes Yes Specifies the pattern of files in the ${maven.build.dir} directory that are not to be included in the resulting ear file. It defaults to blank, that is, nothing is excluded.
maven.j2ee.ear.appxml Yes Specifies the deployment descriptor to be used when building the ear file. It will be placed in /application.xml of the resulting ear file. It defaults to ${maven.conf.dir}/${maven.j2ee.ear.name}-application.xml