maven-plugins/ear/xdocs/properties.xml
aheritier b5a4fb896b Fix XHTML
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@388489 13f79535-47bb-0310-9956-ffa450edef68
2006-03-24 11:22:07 +00:00

278 lines
8.6 KiB
XML

<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
/*
* Copyright 2001-2004 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.
*/
-->
<document>
<properties>
<title>Properties</title>
<author email="nathan.coast@blueyonder.co.uk">Nathan Coast</author>
</properties>
<body>
<section name="ear settings">
<table>
<tr><th>Property</th><th>Optional?</th><th>Description</th><th>Default</th></tr>
<tr>
<td>maven.ear.final.name</td>
<td>Yes</td>
<td>Name of the generated EAR file.</td>
<td>
${maven.final.name}.ear
</td>
</tr>
<tr>
<td>maven.ear.manifest</td>
<td>Yes</td>
<td>
Location of the manifest file to be used within the ear file.
</td>
<td>
${maven.ear.src}/META-INF/MANIFEST.MF
</td>
</tr>
<tr>
<td>maven.ear.displayname</td>
<td>Yes</td>
<td>
Display name of the application to be used
when <code>application.xml</code> file is autogenerated
</td>
<td>
${pom.artifactId}
</td>
</tr>
<tr>
<td>maven.ear.resources</td>
<td>Yes</td>
<td>
Directory that resources are copied to during the build.<b>NOTE:</b> cannot have the same value of ${maven.ear.src}!
</td>
<td>
${maven.build.dir}/ear
</td>
</tr>
<tr>
<td>maven.ear.src</td>
<td>Yes</td>
<td>
Single directory for extra files to include in the EAR. <b>NOTE:</b> cannot have the same value of ${maven.ear.resources}!
</td>
<td>
${maven.src.dir}/application
</td>
</tr>
<tr>
<td>maven.ear.descriptordir</td>
<td>Yes</td>
<td>
Directory where the <code>application.xml</code> file will be auto-generated (only if <code>maven.ear.appxml.generate</code> is true).
</td>
<td>
${maven.build.dir}
</td>
</tr>
<tr>
<td>maven.ear.appxml</td>
<td>Yes</td>
<td>
Location of the <code>application.xml</code> file
to be used within the ear file.
</td>
<td>
${maven.ear.src}/META-INF/application.xml
</td>
</tr>
<tr>
<td>maven.ear.appxml.generate</td>
<td>Yes</td>
<td>
Indicates if <code>application.xml</code> files should
be autogenerated
</td>
<td>
false
</td>
</tr>
<tr>
<td>maven.ear.appxml.version</td>
<td>Yes</td>
<td>
Inserts the doctype header depending on the specified version.
</td>
<td>
1.3
</td>
</tr>
<tr>
<td>maven.ear.appxml.encoding</td>
<td>Yes</td>
<td>
Character encoding for the auto-generated <code>application.xml</code> file.
</td>
<td>
UTF-8
</td>
</tr>
<tr>
<td>maven.ear.appxml.description</td>
<td>Yes</td>
<td>
The description element inserted in the descriptor.
</td>
<td>
${pom.description}
</td>
</tr>
<tr>
<td>maven.ear.appxml.securityRoles</td>
<td>Yes</td>
<td>
A comma-separated list of role names. Will create xml element <code>security-role</code> with sub-element <code>role-name</code>.
</td>
<td>
Empty
</td>
</tr>
</table>
</section>
<section name="other settings">
<table>
<tr><th>Property</th><th>Description</th><th>See</th></tr>
<tr>
<td>maven.build.dir</td>
<td>where the component will be assembled</td>
<td>
<a href="http://maven.apache.org/maven-1.x/plugins/java/properties.html#Other_Settings">maven.build.dir</a>
</td>
</tr>
<tr>
<td>maven.final.name</td>
<td>The assembled component will be <code>${maven.build.dir}/${maven.final.name}.ear</code></td>
<td>
<a href="http://maven.apache.org/maven-1.x/plugins/java/properties.html#Other_Settings">maven.final.name</a>
</td>
</tr>
</table>
</section>
<section name="Including artifacts in the ear file">
<p>
You must tell Maven what artifact you want to include in the ear.
This operation is type sensitive.
Maven can bundle in ear artifacts of following types: jar, war, ejb, rar, sar.
Artifacts of other types are ignored.
This is achieved by specifying meta-information in the POM, using the
following syntax:
</p>
<source><![CDATA[
<dependency>
<groupId>groupId</groupId>
<artifactId>ejbArtifactId</artifactId>
<version>aversion</version>
<type>ejb</type>
<properties>
<ear.bundle>true</ear.bundle>
</properties>
</dependency>
]]></source>
<p>
Those artifacts will be also "visible" during generation
of <code>application.xml</code> file. In case of war artifacts you can also
specify context root which will be set in <code>application.xml</code> file:
</p>
<source><![CDATA[
<dependency>
<groupId>groupId</groupId>
<artifactId>warArtifactId</artifactId>
<version>aversion</version>
<type>war</type>
<properties>
<ear.bundle>true</ear.bundle>
<ear.appxml.war.context-root>webapp</ear.appxml.war.context-root>
</properties>
</dependency>
]]></source>
<p>
Note that by default the artifacts will be bundled in the EAR's root directory. To change the location where an artifact is bundled, please use the <code>ear.bundle.dir</code> property:
</p>
<source><![CDATA[
<dependency>
<groupId>groupId</groupId>
<artifactId>jarArtifactId</artifactId>
<version>aversion</version>
<type>jar</type>
<properties>
<ear.bundle>true</ear.bundle>
<ear.bundle.dir>APP-INF/lib</ear.bundle.dir>
</properties>
</dependency>
]]></source>
<p>(it does not matter if the value of <code>ear.bundle.dir</code> starts with a slash (<code>/</code>) or not - it will always be relative to the root of the EAR)</p>
<p>
It is also possible to change the name by which the dependency will be bundles using the <code>ear.bundle.name</code> property:
</p>
<source><![CDATA[
<dependency>
<groupId>groupId</groupId>
<artifactId>jarArtifactId</artifactId>
<version>aversion</version>
<type>jar</type>
<properties>
<ear.bundle>true</ear.bundle>
<ear.bundle.name>aJar</ear.bundle.name>
</properties>
</dependency>
]]></source>
<p>In the example above, the dependency will be bundled simply as <code>aJar</code> and not <code>jarArtifactId.aversion</code>; note that <code>ear.bundle.name</code> and <code>ear.bundle.dir</code> can be used together:</p>
<source><![CDATA[
<dependency>
<groupId>groupId</groupId>
<artifactId>jarArtifactId</artifactId>
<version>aversion</version>
<type>jar</type>
<properties>
<ear.bundle>true</ear.bundle>
<ear.bundle.name>aJar</ear.bundle.name>
<ear.bundle.dir>/anotherDir</ear.bundle.dir>
</properties>
</dependency>
]]></source>
<p>
Finally, please note that if a jar is a java client module, you will need to declare
it using the <code>ear.module</code> property, rather than ear.bundle:
</p>
<source><![CDATA[
<dependency>
<groupId>groupId</groupId>
<artifactId>jarArtifactId</artifactId>
<version>aversion</version>
<type>jar</type>
<properties>
<ear.module>true</ear.module>
</properties>
</dependency>
]]></source>
</section>
</body>
</document>