PR: MPEAR-17
Submitted by: Charles Crouch Added support to set the description in the generated application.xml git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@388486 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2a139378ae
commit
837fcaa52f
290
ear/plugin.jelly
290
ear/plugin.jelly
@ -16,183 +16,131 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
-->
|
-->
|
||||||
|
<project xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:artifact="artifact" xmlns:license="license" xmlns:maven="jelly:maven" xmlns:util="jelly:util" xmlns:x="jelly:xml" xmlns:define="jelly:define" xmlns:ear="ear">
|
||||||
|
|
||||||
<project
|
|
||||||
xmlns:j="jelly:core"
|
|
||||||
xmlns:ant="jelly:ant"
|
|
||||||
xmlns:artifact="artifact"
|
|
||||||
xmlns:license="license"
|
|
||||||
xmlns:maven="jelly:maven"
|
|
||||||
xmlns:util="jelly:util"
|
|
||||||
xmlns:x="jelly:xml"
|
|
||||||
xmlns:define="jelly:define"
|
|
||||||
xmlns:ear="ear"
|
|
||||||
>
|
|
||||||
|
|
||||||
<!--==================================================================-->
|
<!--==================================================================-->
|
||||||
<!-- Default goal : Builds a ear file -->
|
<!-- Default goal : Builds a ear file -->
|
||||||
<!--==================================================================-->
|
<!--==================================================================-->
|
||||||
<goal name="ear" prereqs="ear:ear" description="Build an ear file"/>
|
<goal name="ear" prereqs="ear:ear" description="Build an ear file"/>
|
||||||
|
|
||||||
<!--==================================================================-->
|
<!--==================================================================-->
|
||||||
<!-- Initializations -->
|
<!-- Initializations -->
|
||||||
<!--==================================================================-->
|
<!--==================================================================-->
|
||||||
<goal name="ear:init"
|
<goal name="ear:init" description="Initialise filesystem and other resources for an ear">
|
||||||
description="Initialise filesystem and other resources for an ear">
|
|
||||||
|
|
||||||
</goal>
|
</goal>
|
||||||
|
|
||||||
<!--==================================================================-->
|
<!--==================================================================-->
|
||||||
<!-- Builds an ear file -->
|
<!-- Builds an ear file -->
|
||||||
<!--==================================================================-->
|
<!--==================================================================-->
|
||||||
<goal name="ear:ear" prereqs="ear:init" description="Build an ear file">
|
<goal name="ear:ear" prereqs="ear:init" description="Build an ear file">
|
||||||
|
|
||||||
<!-- maven.ear.src and maven.war.resources cannot have the same value -->
|
<!-- maven.ear.src and maven.war.resources cannot have the same value -->
|
||||||
<j:if test="${context.getVariable('maven.ear.src') == context.getVariable('maven.ear.resources')}">
|
<j:if test="${context.getVariable('maven.ear.src') == context.getVariable('maven.ear.resources')}">
|
||||||
<ant:fail>Properties maven.ear.src and maven.ear.resources cannot have the same value</ant:fail>
|
<ant:fail>Properties maven.ear.src and maven.ear.resources cannot have the same value</ant:fail>
|
||||||
</j:if>
|
</j:if>
|
||||||
|
<ant:mkdir dir="${maven.build.dir}"/>
|
||||||
<ant:mkdir dir="${maven.build.dir}" />
|
|
||||||
|
|
||||||
<j:set var="finalAppxml" value="${maven.ear.descriptordir}/application.xml"/>
|
<j:set var="finalAppxml" value="${maven.ear.descriptordir}/application.xml"/>
|
||||||
<j:set var="isGenerateAppXML"
|
<j:set var="isGenerateAppXML" value="${context.getVariable('maven.ear.appxml.generate')}"/>
|
||||||
value="${context.getVariable('maven.ear.appxml.generate')}"/>
|
|
||||||
<!-- make sure that target directory exists -->
|
<!-- make sure that target directory exists -->
|
||||||
<ant:mkdir dir="${maven.ear.descriptordir}"/>
|
<ant:mkdir dir="${maven.ear.descriptordir}"/>
|
||||||
<j:choose>
|
<j:choose>
|
||||||
<j:when test="${isGenerateAppXML == 'true'}">
|
<j:when test="${isGenerateAppXML == 'true'}">
|
||||||
<attainGoal name="ear:generate-ear-descriptor"/>
|
<attainGoal name="ear:generate-ear-descriptor"/>
|
||||||
</j:when>
|
</j:when>
|
||||||
<j:otherwise>
|
<j:otherwise>
|
||||||
<util:available file="${maven.ear.appxml}">
|
<util:available file="${maven.ear.appxml}">
|
||||||
<ant:copy file="${maven.ear.appxml}" tofile="${finalAppxml}"/>
|
<ant:copy file="${maven.ear.appxml}" tofile="${finalAppxml}"/>
|
||||||
</util:available>
|
</util:available>
|
||||||
</j:otherwise>
|
</j:otherwise>
|
||||||
</j:choose>
|
</j:choose>
|
||||||
|
|
||||||
|
|
||||||
<ant:echo>Building EAR ${maven.ear.final.name} with appxml "${finalAppxml}"</ant:echo>
|
<ant:echo>Building EAR ${maven.ear.final.name} with appxml "${finalAppxml}"</ant:echo>
|
||||||
|
<ant:available property="maven.ear.manifest.available" file="${maven.ear.manifest}"/>
|
||||||
<ant:available property="maven.ear.manifest.available"
|
<ant:ear destfile="${maven.build.dir}/${maven.ear.final.name}" appxml="${finalAppxml}">
|
||||||
file="${maven.ear.manifest}"/>
|
|
||||||
|
|
||||||
<ant:ear destfile="${maven.build.dir}/${maven.ear.final.name}"
|
|
||||||
appxml="${finalAppxml}">
|
|
||||||
|
|
||||||
<!-- include files from maven.ear.src if available -->
|
<!-- include files from maven.ear.src if available -->
|
||||||
<util:available file="${maven.ear.src}">
|
<util:available file="${maven.ear.src}">
|
||||||
<fileset dir="${maven.ear.src}" casesensitive="false"
|
<fileset dir="${maven.ear.src}" casesensitive="false" excludes="**/META-INF/application.xml"/>
|
||||||
excludes="**/META-INF/application.xml"/>
|
|
||||||
</util:available>
|
</util:available>
|
||||||
|
|
||||||
<!-- include marked dependencies -->
|
<!-- include marked dependencies -->
|
||||||
<j:set var="tmpDependenciesDir" value="${maven.build.dir}/tmpEarDeps"/>
|
<j:set var="tmpDependenciesDir" value="${maven.build.dir}/tmpEarDeps"/>
|
||||||
<j:forEach var="lib" items="${pom.artifacts}">
|
<j:forEach var="lib" items="${pom.artifacts}">
|
||||||
<j:set var="dep" value="${lib.dependency}"/>
|
<j:set var="dep" value="${lib.dependency}"/>
|
||||||
<j:if test="${dep.getProperty('ear.bundle')=='true' || dep.getProperty('ear.module')=='true'}">
|
<j:if test="${dep.getProperty('ear.bundle')=='true' || dep.getProperty('ear.module')=='true'}">
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
We know that this dep "wants" to be bundled. Now we need to decide how it is copied into the
|
We know that this dep "wants" to be bundled. Now we need to decide how it is copied into the
|
||||||
EAR
|
EAR
|
||||||
-->
|
-->
|
||||||
|
<j:set var="originalPath" value="${lib.file.name}"/>
|
||||||
<j:set var="originalPath" value="${lib.file.name}"/>
|
<ear:setPath lib="${lib}" var="bundledPath"/>
|
||||||
<ear:setPath lib="${lib}" var="bundledPath"/>
|
<j:choose>
|
||||||
|
<j:when test="${originalPath.equals(bundledPath)}">
|
||||||
|
<ant:fileset dir="${lib.file.parent}">
|
||||||
<j:choose>
|
<ant:include name="${originalPath}"/>
|
||||||
<j:when test="${originalPath.equals(bundledPath)}">
|
</ant:fileset>
|
||||||
<ant:fileset dir="${lib.file.parent}">
|
</j:when>
|
||||||
<ant:include name="${originalPath}"/>
|
<j:otherwise>
|
||||||
</ant:fileset>
|
<echo>Dependency ${originalPath} will be bundled as ${bundledPath}</echo>
|
||||||
</j:when>
|
<ant:copy file="${lib.file.parent}/${originalPath}" tofile="${tmpDependenciesDir}/${bundledPath}"/>
|
||||||
<j:otherwise>
|
</j:otherwise>
|
||||||
<echo>Dependency ${originalPath} will be bundled as ${bundledPath}</echo>
|
</j:choose>
|
||||||
<ant:copy file="${lib.file.parent}/${originalPath}" tofile="${tmpDependenciesDir}/${bundledPath}"/>
|
|
||||||
</j:otherwise>
|
|
||||||
</j:choose>
|
|
||||||
|
|
||||||
</j:if>
|
</j:if>
|
||||||
</j:forEach>
|
</j:forEach>
|
||||||
|
|
||||||
<!-- bundle all dependencies that were copied to a temporary dir -->
|
<!-- bundle all dependencies that were copied to a temporary dir -->
|
||||||
<util:available file="${tmpDependenciesDir}">
|
<util:available file="${tmpDependenciesDir}">
|
||||||
<ant:fileset dir="${tmpDependenciesDir}"/>
|
<ant:fileset dir="${tmpDependenciesDir}"/>
|
||||||
</util:available>
|
</util:available>
|
||||||
|
|
||||||
<!-- include license -->
|
<!-- include license -->
|
||||||
<j:set var="licenseFileName"><license:fileName/></j:set>
|
<j:set var="licenseFileName">
|
||||||
|
<license:fileName/>
|
||||||
|
</j:set>
|
||||||
<util:file name="${licenseFileName}" var="licenseFile"/>
|
<util:file name="${licenseFileName}" var="licenseFile"/>
|
||||||
<ant:metainf dir="${licenseFile.canonicalFile.parent}">
|
<ant:metainf dir="${licenseFile.canonicalFile.parent}">
|
||||||
<ant:include name="${licenseFile.canonicalFile.name}"/>
|
<ant:include name="${licenseFile.canonicalFile.name}"/>
|
||||||
</ant:metainf>
|
</ant:metainf>
|
||||||
|
|
||||||
<j:if test="${maven.ear.manifest.available}">
|
<j:if test="${maven.ear.manifest.available}">
|
||||||
<ant:setProperty name="manifest" value="${maven.ear.manifest}" />
|
<ant:setProperty name="manifest" value="${maven.ear.manifest}"/>
|
||||||
</j:if>
|
</j:if>
|
||||||
|
|
||||||
<!-- standard manifest entries -->
|
<!-- standard manifest entries -->
|
||||||
<ant:manifest>
|
<ant:manifest>
|
||||||
<ant:attribute name="Built-By" value="${user.name}" />
|
<ant:attribute name="Built-By" value="${user.name}"/>
|
||||||
<ant:section name="${pom.package}">
|
<ant:section name="${pom.package}">
|
||||||
<ant:attribute name="Specification-Title" value="${pom.artifactId}" />
|
<ant:attribute name="Specification-Title" value="${pom.artifactId}"/>
|
||||||
<ant:attribute name="Specification-Version"
|
<ant:attribute name="Specification-Version" value="${pom.currentVersion}"/>
|
||||||
value="${pom.currentVersion}" />
|
<ant:attribute name="Specification-Vendor" value="${pom.organization.name}"/>
|
||||||
<ant:attribute name="Specification-Vendor"
|
<ant:attribute name="Implementation-Title" value="${pom.package}"/>
|
||||||
value="${pom.organization.name}" />
|
<ant:attribute name="Implementation-Version" value="${pom.currentVersion}"/>
|
||||||
<ant:attribute name="Implementation-Title"
|
<ant:attribute name="Implementation-Vendor" value="${pom.organization.name}"/>
|
||||||
value="${pom.package}" />
|
|
||||||
<ant:attribute name="Implementation-Version"
|
|
||||||
value="${pom.currentVersion}" />
|
|
||||||
<ant:attribute name="Implementation-Vendor"
|
|
||||||
value="${pom.organization.name}" />
|
|
||||||
</ant:section>
|
</ant:section>
|
||||||
</ant:manifest>
|
</ant:manifest>
|
||||||
|
|
||||||
<j:if test="${!pom.build.resources.isEmpty()}">
|
<j:if test="${!pom.build.resources.isEmpty()}">
|
||||||
<mkdir dir="${maven.ear.resources}"/>
|
<mkdir dir="${maven.ear.resources}"/>
|
||||||
<maven:copy-resources resources="${pom.build.resources}" todir="${maven.ear.resources}"/>
|
<maven:copy-resources resources="${pom.build.resources}" todir="${maven.ear.resources}"/>
|
||||||
<fileset dir="${maven.ear.resources}" />
|
<fileset dir="${maven.ear.resources}"/>
|
||||||
</j:if>
|
</j:if>
|
||||||
|
|
||||||
</ant:ear>
|
</ant:ear>
|
||||||
|
|
||||||
<!-- delete temporary directory -->
|
<!-- delete temporary directory -->
|
||||||
<util:available file="${tmpDependenciesDir}">
|
<util:available file="${tmpDependenciesDir}">
|
||||||
<ant:delete dir="${tmpDependenciesDir}"/>
|
<ant:delete dir="${tmpDependenciesDir}"/>
|
||||||
</util:available>
|
</util:available>
|
||||||
|
|
||||||
</goal>
|
</goal>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--==================================================================-->
|
<!--==================================================================-->
|
||||||
<!-- Creates ear descriptor - application.xml file -->
|
<!-- Creates ear descriptor - application.xml file -->
|
||||||
<!--==================================================================-->
|
<!--==================================================================-->
|
||||||
<goal name="ear:generate-ear-descriptor" description="Generates the ear descriptor">
|
<goal name="ear:generate-ear-descriptor" description="Generates the ear descriptor">
|
||||||
|
<ant:echo>Generating appxml file:"${finalAppxml} version ${maven.ear.appxml.version} encoding: ${maven.ear.appxml.encoding}"</ant:echo>
|
||||||
<ant:echo>Generating appxml file:"${finalAppxml} version ${maven.ear.appxml.version} encoding: ${maven.ear.appxml.encoding}"</ant:echo>
|
<j:file name="${finalAppxml}" outputMode="xml" prettyPrint="true" encoding="${maven.ear.appxml.encoding}">
|
||||||
|
<j:switch on="${maven.ear.appxml.version}">
|
||||||
<j:file name="${finalAppxml}"
|
<j:case value="1.3">
|
||||||
outputMode="xml"
|
<x:doctype name="application" publicId="-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" systemId="http://java.sun.com/dtd/application_1_3.dtd"/>
|
||||||
prettyPrint="true"
|
</j:case>
|
||||||
encoding="${maven.ear.appxml.encoding}"
|
<j:default>
|
||||||
>
|
<x:doctype name="application" publicId="-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN" systemId="http://java.sun.com/j2ee/dtds/application_1_2.dtd"/>
|
||||||
|
</j:default>
|
||||||
<j:switch on="${maven.ear.appxml.version}">
|
</j:switch>
|
||||||
<j:case value="1.3">
|
<x:element name="application">
|
||||||
<x:doctype name="application" publicId="-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" systemId="http://java.sun.com/dtd/application_1_3.dtd"/>
|
|
||||||
</j:case>
|
|
||||||
<j:default>
|
|
||||||
<x:doctype name="application" publicId="-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN" systemId="http://java.sun.com/j2ee/dtds/application_1_2.dtd"/>
|
|
||||||
</j:default>
|
|
||||||
</j:switch>
|
|
||||||
|
|
||||||
<x:element name="application">
|
|
||||||
<x:element name="display-name">${maven.ear.displayname}</x:element>
|
<x:element name="display-name">${maven.ear.displayname}</x:element>
|
||||||
|
<j:set var="applicationDescription" value="${maven.ear.appxml.description}"/>
|
||||||
|
<j:if test="${!empty(applicationDescription)}">
|
||||||
|
<x:element name="description">${maven.ear.appxml.description}</x:element>
|
||||||
|
</j:if>
|
||||||
<j:forEach var="lib" items="${pom.artifacts}">
|
<j:forEach var="lib" items="${pom.artifacts}">
|
||||||
<j:set var="dep" value="${lib.dependency}"/>
|
<j:set var="dep" value="${lib.dependency}"/>
|
||||||
<ear:setPath lib="${lib}" var="bundledPath"/>
|
<ear:setPath lib="${lib}" var="bundledPath"/>
|
||||||
<j:if test="${dep.getProperty('ear.bundle')=='true' || dep.getProperty('ear.module')=='true'}">
|
<j:if test="${dep.getProperty('ear.bundle')=='true' || dep.getProperty('ear.module')=='true'}">
|
||||||
<j:choose>
|
<j:choose>
|
||||||
@ -201,7 +149,7 @@
|
|||||||
<x:element name="web">
|
<x:element name="web">
|
||||||
<x:element name="web-uri">${bundledPath}</x:element>
|
<x:element name="web-uri">${bundledPath}</x:element>
|
||||||
<x:element name="context-root">${dep.getProperty('ear.appxml.war.context-root')}</x:element>
|
<x:element name="context-root">${dep.getProperty('ear.appxml.war.context-root')}</x:element>
|
||||||
</x:element>
|
</x:element>
|
||||||
</x:element>
|
</x:element>
|
||||||
</j:when>
|
</j:when>
|
||||||
<j:when test="${dep.type=='ejb'}">
|
<j:when test="${dep.type=='ejb'}">
|
||||||
@ -236,77 +184,41 @@
|
|||||||
</j:forEach>
|
</j:forEach>
|
||||||
<!-- add the security-role element -->
|
<!-- add the security-role element -->
|
||||||
<j:set var="securityRoles" value="${maven.ear.appxml.securityRoles}"/>
|
<j:set var="securityRoles" value="${maven.ear.appxml.securityRoles}"/>
|
||||||
<j:if test="${!empty(securityRoles)}">
|
<j:if test="${!empty(securityRoles)}">
|
||||||
<util:tokenize var="roles" delim="," trim="true">${maven.ear.appxml.securityRoles}</util:tokenize>
|
<util:tokenize var="roles" delim="," trim="true">${maven.ear.appxml.securityRoles}</util:tokenize>
|
||||||
<j:forEach var="role" items="${roles}">
|
<j:forEach var="role" items="${roles}">
|
||||||
<x:element name="security-role">
|
<x:element name="security-role">
|
||||||
<x:element name="role-name">${role.trim()}</x:element>
|
<x:element name="role-name">${role.trim()}</x:element>
|
||||||
</x:element>
|
</x:element>
|
||||||
</j:forEach>
|
</j:forEach>
|
||||||
</j:if >
|
</j:if>
|
||||||
</x:element>
|
</x:element>
|
||||||
</j:file>
|
</j:file>
|
||||||
|
</goal>
|
||||||
</goal>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--==================================================================-->
|
<!--==================================================================-->
|
||||||
<!-- Install the ear in the local repository -->
|
<!-- Install the ear in the local repository -->
|
||||||
<!--==================================================================-->
|
<!--==================================================================-->
|
||||||
<goal name="ear:install"
|
<goal name="ear:install" prereqs="ear:ear" description="Install the ear in the local repository">
|
||||||
prereqs="ear:ear"
|
<artifact:install artifact="${maven.build.dir}/${maven.ear.final.name}" type="ear" project="${pom}"/>
|
||||||
description="Install the ear in the local repository">
|
|
||||||
|
|
||||||
<artifact:install
|
|
||||||
artifact="${maven.build.dir}/${maven.ear.final.name}"
|
|
||||||
type="ear"
|
|
||||||
project="${pom}"/>
|
|
||||||
|
|
||||||
</goal>
|
</goal>
|
||||||
|
|
||||||
<!--==================================================================-->
|
<!--==================================================================-->
|
||||||
<!-- Install the snapshot version of the ear in the local repository -->
|
<!-- Install the snapshot version of the ear in the local repository -->
|
||||||
<!--==================================================================-->
|
<!--==================================================================-->
|
||||||
<goal name="ear:install-snapshot"
|
<goal name="ear:install-snapshot" prereqs="ear:ear" description="Install the snapshot version of the ear in the local repository">
|
||||||
prereqs="ear:ear"
|
<artifact:install-snapshot artifact="${maven.build.dir}/${maven.ear.final.name}" type="ear" project="${pom}"/>
|
||||||
description="Install the snapshot version of the ear in the local repository">
|
|
||||||
|
|
||||||
<artifact:install-snapshot
|
|
||||||
artifact="${maven.build.dir}/${maven.ear.final.name}"
|
|
||||||
type="ear"
|
|
||||||
project="${pom}"/>
|
|
||||||
|
|
||||||
</goal>
|
</goal>
|
||||||
|
|
||||||
<!--==================================================================-->
|
<!--==================================================================-->
|
||||||
<!-- Deploys the ear to the remote repository -->
|
<!-- Deploys the ear to the remote repository -->
|
||||||
<!--==================================================================-->
|
<!--==================================================================-->
|
||||||
<goal name="ear:deploy"
|
<goal name="ear:deploy" prereqs="ear:ear" description="Deploys the ear to the remote repository">
|
||||||
prereqs="ear:ear"
|
<artifact:deploy artifact="${maven.build.dir}/${maven.ear.final.name}" type="ear" project="${pom}"/>
|
||||||
description="Deploys the ear to the remote repository">
|
|
||||||
|
|
||||||
<artifact:deploy
|
|
||||||
artifact="${maven.build.dir}/${maven.ear.final.name}"
|
|
||||||
type="ear"
|
|
||||||
project="${pom}"/>
|
|
||||||
|
|
||||||
</goal>
|
</goal>
|
||||||
|
|
||||||
<!--==================================================================-->
|
<!--==================================================================-->
|
||||||
<!-- Deploys the snapshot version of the ear to the remote repository -->
|
<!-- Deploys the snapshot version of the ear to the remote repository -->
|
||||||
<!--==================================================================-->
|
<!--==================================================================-->
|
||||||
<goal name="ear:deploy-snapshot"
|
<goal name="ear:deploy-snapshot" prereqs="ear:ear" description="Deploys the snapshot version of the ear to remote repository">
|
||||||
prereqs="ear:ear"
|
<artifact:deploy-snapshot artifact="${maven.build.dir}/${maven.ear.final.name}" type="ear" project="${pom}"/>
|
||||||
description="Deploys the snapshot version of the ear to remote repository">
|
|
||||||
|
|
||||||
<artifact:deploy-snapshot
|
|
||||||
artifact="${maven.build.dir}/${maven.ear.final.name}"
|
|
||||||
type="ear"
|
|
||||||
project="${pom}"/>
|
|
||||||
|
|
||||||
</goal>
|
</goal>
|
||||||
|
|
||||||
<!--==================================================================-->
|
<!--==================================================================-->
|
||||||
<!-- Special no-op goal which can be used by other plugin which need -->
|
<!-- Special no-op goal which can be used by other plugin which need -->
|
||||||
<!-- to get access to any of this plugin's property. This is -->
|
<!-- to get access to any of this plugin's property. This is -->
|
||||||
@ -315,11 +227,7 @@
|
|||||||
<goal name="ear:load">
|
<goal name="ear:load">
|
||||||
<echo>DEPRECATED: do not use ear:load, there is no need</echo>
|
<echo>DEPRECATED: do not use ear:load, there is no need</echo>
|
||||||
</goal>
|
</goal>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<define:taglib uri="ear">
|
<define:taglib uri="ear">
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Sets the relative path of a dependency in the EAR file
|
Sets the relative path of a dependency in the EAR file
|
||||||
parameters:
|
parameters:
|
||||||
@ -328,32 +236,28 @@
|
|||||||
|
|
||||||
-->
|
-->
|
||||||
<define:tag name="setPath">
|
<define:tag name="setPath">
|
||||||
<j:set var="dep" value="${lib.dependency}"/>
|
<j:set var="dep" value="${lib.dependency}"/>
|
||||||
<!-- define the directory where the dependency will be included -->
|
<!-- define the directory where the dependency will be included -->
|
||||||
<!-- (if the property is not set, dir is the root) -->
|
<!-- (if the property is not set, dir is the root) -->
|
||||||
<j:set var="bundleDir" value="${dep.getProperty('ear.bundle.dir')}"/>
|
<j:set var="bundleDir" value="${dep.getProperty('ear.bundle.dir')}"/>
|
||||||
<!-- define the name of the dependency -->
|
<!-- define the name of the dependency -->
|
||||||
<j:set var="bundleName" value="${dep.getProperty('ear.bundle.name')}"/>
|
<j:set var="bundleName" value="${dep.getProperty('ear.bundle.name')}"/>
|
||||||
<j:if test="${empty(bundleName)}">
|
<j:if test="${empty(bundleName)}">
|
||||||
<j:set var="bundleName" value="${lib.name}"/>
|
<j:set var="bundleName" value="${lib.name}"/>
|
||||||
</j:if>
|
</j:if>
|
||||||
<j:choose>
|
<j:choose>
|
||||||
<j:when test="${empty(bundleDir)}">
|
<j:when test="${empty(bundleDir)}">
|
||||||
<j:set var="thePath" value="${bundleName}"/>
|
<j:set var="thePath" value="${bundleName}"/>
|
||||||
</j:when>
|
</j:when>
|
||||||
<j:otherwise>
|
<j:otherwise>
|
||||||
<j:set var="thePath" value="${bundleDir}/${bundleName}"/>
|
<j:set var="thePath" value="${bundleDir}/${bundleName}"/>
|
||||||
</j:otherwise>
|
</j:otherwise>
|
||||||
</j:choose>
|
</j:choose>
|
||||||
${context.setVariable(var,'parent',thePath)}
|
${context.setVariable(var,'parent',thePath)}
|
||||||
</define:tag>
|
</define:tag>
|
||||||
|
|
||||||
<define:tag name="resolver">
|
<define:tag name="resolver">
|
||||||
<j:new var="resolver" className="org.apache.maven.ear.j2ee.J2EEEntityResolver" />
|
<j:new var="resolver" className="org.apache.maven.ear.j2ee.J2EEEntityResolver"/>
|
||||||
<j:set var="${var}" value="${resolver}" scope="parent" />
|
<j:set var="${var}" value="${resolver}" scope="parent"/>
|
||||||
</define:tag>
|
</define:tag>
|
||||||
|
|
||||||
</define:taglib>
|
</define:taglib>
|
||||||
|
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@ -25,15 +25,17 @@ maven.ear.src=${maven.src.dir}/application
|
|||||||
|
|
||||||
# Location of xml configs and manifest files
|
# Location of xml configs and manifest files
|
||||||
maven.ear.descriptordir=${maven.build.dir}
|
maven.ear.descriptordir=${maven.build.dir}
|
||||||
maven.ear.appxml=${maven.ear.src}/META-INF/application.xml
|
|
||||||
maven.ear.manifest=${maven.ear.src}/META-INF/MANIFEST.MF
|
maven.ear.manifest=${maven.ear.src}/META-INF/MANIFEST.MF
|
||||||
maven.ear.appxml.generate=false
|
|
||||||
maven.ear.displayname=${pom.artifactId}
|
maven.ear.displayname=${pom.artifactId}
|
||||||
maven.ear.appxml.version=1.3
|
|
||||||
maven.ear.resources=${maven.build.dir}/ear
|
maven.ear.resources=${maven.build.dir}/ear
|
||||||
maven.ear.appxml.encoding=UTF-8
|
|
||||||
# Name of generated EAR file
|
# Name of generated EAR file
|
||||||
maven.ear.final.name=${maven.final.name}.ear
|
maven.ear.final.name=${maven.final.name}.ear
|
||||||
|
|
||||||
|
maven.ear.appxml=${maven.ear.src}/META-INF/application.xml
|
||||||
|
maven.ear.appxml.generate=false
|
||||||
|
maven.ear.appxml.version=1.3
|
||||||
|
maven.ear.appxml.encoding=UTF-8
|
||||||
# Security role (a comma separated list)
|
# Security role (a comma separated list)
|
||||||
# maven.ear.appxml.securityRoles = role1, role2
|
# maven.ear.appxml.securityRoles = role1, role2
|
||||||
|
# Description
|
||||||
|
maven.ear.appxml.description=${pom.description}
|
||||||
@ -56,6 +56,9 @@
|
|||||||
value="${firstJavaModule}"
|
value="${firstJavaModule}"
|
||||||
msg="commons collections was not the first java module"/>
|
msg="commons collections was not the first java module"/>
|
||||||
|
|
||||||
|
<x:set var="description" select="string($applicationDoc/application/description)"/>
|
||||||
|
<assert:assertEquals expected="${pom.description.trim()}" value="${description.trim()}"/>
|
||||||
|
|
||||||
<!-- check for resources -->
|
<!-- check for resources -->
|
||||||
<assert:assertFileExists file="${unzipDir}/resource.txt"/>
|
<assert:assertFileExists file="${unzipDir}/resource.txt"/>
|
||||||
|
|
||||||
|
|||||||
@ -23,6 +23,9 @@
|
|||||||
<author email="nathan.coast@blueyonder.co.uk">Nathan Coast</author>
|
<author email="nathan.coast@blueyonder.co.uk">Nathan Coast</author>
|
||||||
</properties>
|
</properties>
|
||||||
<body>
|
<body>
|
||||||
|
<release version="1.9-SNAPSHOT" date="In SVN">
|
||||||
|
<action dev="aheritier" type="add" issue="MPEAR-17">Added support to set the description and the security roles in the generated application.xml.</action>
|
||||||
|
</release>
|
||||||
<release version="1.8" date="2006-03-08">
|
<release version="1.8" date="2006-03-08">
|
||||||
<action dev="snicoll" type="fix" issue="MPEAR-33">Added support of JbossNet archive in application.xml generation.</action>
|
<action dev="snicoll" type="fix" issue="MPEAR-33">Added support of JbossNet archive in application.xml generation.</action>
|
||||||
<action dev="aheritier" type="update" issue="MAVEN-1712">Update dependencies to match ones in maven 1.1 core and to unify them between plugins. The following dependencies are updated :
|
<action dev="aheritier" type="update" issue="MAVEN-1712">Update dependencies to match ones in maven 1.1 core and to unify them between plugins. The following dependencies are updated :
|
||||||
|
|||||||
@ -45,6 +45,47 @@
|
|||||||
${maven.ear.src}/META-INF/MANIFEST.MF
|
${maven.ear.src}/META-INF/MANIFEST.MF
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</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>
|
<tr>
|
||||||
<td>maven.ear.appxml</td>
|
<td>maven.ear.appxml</td>
|
||||||
<td>Yes</td>
|
<td>Yes</td>
|
||||||
@ -77,37 +118,6 @@
|
|||||||
1.3
|
1.3
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</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>
|
<tr>
|
||||||
<td>maven.ear.appxml.encoding</td>
|
<td>maven.ear.appxml.encoding</td>
|
||||||
<td>Yes</td>
|
<td>Yes</td>
|
||||||
@ -119,13 +129,13 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>maven.ear.descriptordir</td>
|
<td>maven.ear.appxml.description</td>
|
||||||
<td>Yes</td>
|
<td>Yes</td>
|
||||||
<td>
|
<td>
|
||||||
Directory where the <code>application.xml</code> file will be auto-generated (only if <code>maven.ear.appxml.generate</code> is true).
|
The description element inserted in the descriptor.
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
${maven.build.dir}
|
${pom.description}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user