------ Usage ------ Stephane Nicoll ------ 2010-12-23 ~~ Copyright 2006 The Apache Software Foundation. ~~ ~~ Licensed under the Apache License, Version 2.0 (the "License"); ~~ you may not use this file except in compliance with the License. ~~ You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, software ~~ distributed under the License is distributed on an "AS IS" BASIS, ~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~~ See the License for the specific language governing permissions and ~~ limitations under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Usage To handle archiving this version of Maven EAR Plugin uses {{{http://maven.apache.org/shared/maven-archiver/index.html}Maven Archiver}} ${mavenArchiverVersion}. To handle filtering this version of Maven EAR Plugin uses {{{http://maven.apache.org/shared/maven-filtering/index.html}Maven Filtering}} ${mavenFilteringVersion}. * Introduction The EAR Plugin allows you to automatically generate the deployment descriptor, e.g. <<>>. This generation is customizable by the goal's parameters, see {{{./plugin-info.html}the goals description}}. * Configuring the EAR Plugin The configuration of the EAR Plugin is not any different from the configuration of any other plugin. The configuration should be similar to: +----- [...] [...] [...] maven-ear-plugin ${project.version} [...] +----- When configuring the EAR Plugin in your <<>>, you do not declare an <<<\>>> element in it because it is always invoked at least once during the <<>> phase of an <<>> project. * Executing and Generating your EAR Package The EAR Plugin replaces the JAR Plugin when your project <<<\>>> is <<>>. So to generate your EAR package, you need only call the <<>> phase like this: +----- mvn package +----- * Copying resources The default resource directory for an EAR is <<>> as defined by the <<>> parameter. The content of this directory may be filtered if necessary using the <<>> parameter. For more details, have a look at the examples. * Advanced Configuration Any EAR module might be further customized as follows: * <>: the directory in the EAR structure where the artifact will be stored. * <>: the name of the artifact in the EAR structure. * <>: the complete path in the EAR structure for the artifact. * <>: excludes the artifact from the generated EAR. * <>: unpack the artifact in the generated EAR. The context root of a Web module might be customized using the <<>> parameter. Please note that third party libraries (i.e. JarModule) are not included in the generated <<>> (only <<>> should be included in a entry). However, a <<>> dependency could be included in the generated <<>> by specifying the <<>> flag. It is also possible to specify a default bundle directory for all third party libraries by specifying the <<>> parameter. The security settings might be specified under the <<>> parameter. The artifact types that should be unpacked by default can be specified using the <<>> parameter. The file name mapping to use for artifacts stored in the EAR can be specified using the <<>> parameter. Valid values for this parameter are <<>> (default), <<>>, <<>> and <<>>. By specifying <<>> as file name mapping, artifacts are prefixed by the <<>> where dots have been replaced by dashes. <<>> can be used as a replacement of the default mapping; the only difference is that the version is omitted. <<>> is a specialization that omits the version only for ejb-jars and keeps it for others ear modules. For more information on EAR modules, please see the {{{./modules.html}modules configuration}} page. You can take a look at the examples for more information on these advanced configurations. * JBoss support The EAR Plugin can generate the <<>> automatically. To do so, the <<<\>>> element must be configured and takes the following child elements: * <>: the targeted JBoss version to use, 3.2, 4, 4.2 or 5 (the default is 4). * <>: the directory where libraries can be found in the EAR (JBoss 4.2+ only). * <>: the JNDI name of the security manager (JBoss 4+ only). * <>: the unauthenticated principal (JBoss 4+ only). * <>: the name of the UnifiedLoaderRepository MBean to use for the EAR to provide ear level scoping of classes deployed in the ear. It can have a <> attribute that defines the class loader repository class to use. * <>: the class loader repository configuration. If no <> element is defined, a default one is added. It can have a <> attribute that defines the class loader's configuration parser class to use. The POM snippet below fully configures the following loader repository +----- dot.com:loader=unique-archive-name java2ParentDelegation=true +----- +----- [...] dot.com:loader=unique-archive-name java2ParentDelegation=true +----- * <>: the object name of the EAR MBean. * <>: specify the order in which the modules specified in the <<>> file gets loaded (JBoss 4.2+ only). * <>: specify the desired data source(s) to add into the <<>>, usage is as follows: +----- [...] main-ds.xml config/secondary-ds.xml [...] +----- Hibernate archives (HAR) and Service archives (SAR) will be recognized automatically and added the the <<>> file. You can take a look at the examples for more information on the JBoss support.