maven-plugins/ear/plugin.jelly
dion 230698d6ee detab
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@113229 13f79535-47bb-0310-9956-ffa450edef68
2003-03-30 16:18:05 +00:00

107 lines
4.2 KiB
XML

<?xml version="1.0"?>
<project
xmlns:j="jelly:core"
xmlns:ant="jelly:ant"
xmlns:license="license"
xmlns:util="jelly:util">
<!--==================================================================-->
<!-- Default goal : Builds a ear file -->
<!--==================================================================-->
<goal name="ear" prereqs="ear:ear" description="Build an ear file"/>
<!--==================================================================-->
<!-- Initializations -->
<!--==================================================================-->
<goal name="ear:init"
description="Initialise filesystem and other resources for an ear">
</goal>
<!--==================================================================-->
<!-- Builds an ear file -->
<!--==================================================================-->
<goal name="ear:ear" prereqs="ear:init" description="Build an ear file">
<ant:echo>Building EAR ${maven.final.name} with appxml "${maven.ear.appxml}"</ant:echo>
<ant:mkdir dir="${maven.build.dir}" />
<ant:available property="maven.ear.manifest.available"
file="${maven.ear.manifest}"/>
<ant:ear destfile="${maven.build.dir}/${maven.final.name}.ear"
appxml="${maven.ear.appxml}"
basedir="${maven.ear.src}"
excludes="${maven.ear.appxml}">
<!-- include marked dependencies -->
<j:forEach var="dep" items="${pom.dependencies}">
<j:if test="${dep.getProperty('ear.bundle.jar')=='true'}">
<ant:fileset dir="${maven.repo.local}/${dep.artifactDirectory}/jars/">
<ant:include name="${dep.artifact}"/>
</ant:fileset>
</j:if>
<j:if test="${dep.getProperty('ear.bundle.war')=='true'}">
<ant:fileset dir="${maven.repo.local}/${dep.artifactDirectory}/wars/">
<ant:include name="${dep.artifact}"/>
</ant:fileset>
</j:if>
<j:if test="${dep.getProperty('ear.bundle.ejb')=='true'}">
<ant:fileset dir="${maven.repo.local}/${dep.artifactDirectory}/ejbs/">
<ant:include name="${dep.artifact}"/>
</ant:fileset>
</j:if>
</j:forEach>
<!-- include license -->
<j:set var="licenseFileName"><license:fileName/></j:set>
<util:file name="${licenseFileName}" var="licenseFile"/>
<ant:metainf dir="${licenseFile.canonicalFile.parent}">
<ant:include name="${licenseFile.canonicalFile.name}"/>
</ant:metainf>
<j:if test="${maven.ear.manifest.available}">
<ant:setProperty name="manifest" value="${maven.ear.manifest}" />
</j:if>
<!-- standard manifest entries -->
<ant:manifest>
<ant:attribute name="Built-By" value="${user.name}" />
<ant:section name="${pom.package}">
<ant:attribute name="Specification-Title" value="${pom.artifactId}" />
<ant:attribute name="Specification-Version"
value="${pom.currentVersion}" />
<ant:attribute name="Specification-Vendor"
value="${pom.organization.name}" />
<ant:attribute name="Implementation-Title"
value="${pom.package}" />
<ant:attribute name="Implementation-Version"
value="${pom.currentVersion}" />
<ant:attribute name="Implementation-Vendor"
value="${pom.organization.name}" />
</ant:section>
</ant:manifest>
</ant:ear>
</goal>
<!--==================================================================-->
<!-- Install the ear in the local repository -->
<!--==================================================================-->
<goal name="ear:install"
prereqs="ear:ear"
description="Install the ear in the local repository">
<ant:property name="maven.ear.install.dir"
value="${maven.repo.local}/${pom.artifactDirectory}/ears"/>
<ant:mkdir dir="${maven.ear.install.dir}"/>
<ant:copy file="${maven.build.dir}/${maven.final.name}.ear"
tofile="${maven.ear.install.dir}/${maven.final.name}.ear"/>
</goal>
</project>