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
General Settings These properties specify various settings that may be used in any J2EE Plug-in target.
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.
Appserver These properties detail what application server instance you would like to install and control for your project and how to configure it.

General Settings

PropertyOptional?Description
maven.j2ee.version No for the "appserver:install" goal. Otherwise, Yes. Specifies the version of J2EE you are trying to use. Valid values are:
  • 12
  • 13
The above values represent version 1.2 and 1.3 respectively. The value of this property is especially important for the supported servers used with the appserver control features of this plugin.

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

Application Server

Although application server ( appserver ) instance control is part of the J2EE plugin, all appserver related properties begin with the "maven.appserver" prefix. This is indicative of the large scope of functionality within the appserver targets.

PropertyOptional?Description
maven.appserver.name No Specifies the name of the application server to install and control for your project.

Please refer to the supported servers table for a current list of supported appservers and the ${maven.appserver.name} value they use use.
maven.appserver.version No Specifies the version of the appserver to install and control for your project. Please refer to the supported servers table for a current list of supported appservers and the ${maven.appserver.version} value they use.
maven.appserver.home No Specifies the directory where the shared installation of the appserver resides. This should be the home of the appserver specified by ${maven.appserver.name} and ${maven.appserver.version}.
maven.appserver.dir No Specifies the directory where the appserver instance is installed during the "appserver:install" goal. Defaults to be ${basedir}/server .
maven.appserver.host No Specifies the default host to use to access the started server instance. Defaults to 'localhost'.
maven.appserver.port.http No Specifies the HTTP port number to use to access the started server instance. Defaults to 8080.
maven.appserver.url No The URL that is used to test if your appserver instance is running. This URL must point to a target that will return a response code < 400 when your appserver instance is started. Default value is http://${maven.appserver.host}:${maven.appserver.port.http}/index.html
maven.appserver.port.https Yes Specifies the HTTPS port number to use to access the started server instance using SSL. Defaults to 444.
maven.appserver.port.one Yes Optional additional port you can specify when configuring appserver files during install.
maven.appserver.port.two Yes Optional additional port you can specify when configuring appserver files during install.
maven.appserver.port.three Yes Optional additional port you can specify when configuring appserver files during install.
maven.appserver.classpath Yes A path-like value that can specify resources to make available as part of the classpath of the JVM used when controlling your appserver instance. For example, you may have several webapps running in the same container that require a JDBC driver be available. Adding a reference to that jar here will put it in the classpath of the JVM used to start your appserver.

An example of a valid value might be:

/jars/database.jar;/jars/foobar.jar

Path seperators are automatically converted to their system correct values. By default, there are no additional paths. Jars required to control an appserver are automatically built-in and do not need to be added here.
maven.appserver.rmi.port Yes RMI port you can specify. Example: used to start/stop/restart orion appserver.
maven.appserver.adminusername Yes Admin username to use when communicating with appserver. Example: used to start/stop/restart orion appserver.
maven.appserver.adminpassword Yes Admin password to use when communicating with appserver. Example: used to start/stop/restart orion appserver.