git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@112903 13f79535-47bb-0310-9956-ffa450edef68
107 lines
4.0 KiB
XML
107 lines
4.0 KiB
XML
<?xml version="1.0"?>
|
|
|
|
<project
|
|
xmlns:j="jelly:core"
|
|
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">
|
|
|
|
<echo>Building EAR ${maven.final.name} with appxml "${maven.ear.appxml}"</echo>
|
|
|
|
<mkdir dir="${maven.build.dir}" />
|
|
|
|
|
|
<available property="maven.ear.manifest.available"
|
|
file="${maven.ear.manifest}"/>
|
|
|
|
<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'}">
|
|
<fileset dir="${maven.repo.local}/${dep.artifactDirectory}/jars/">
|
|
<include name="${dep.artifact}"/>
|
|
</fileset>
|
|
</j:if>
|
|
<j:if test="${dep.getProperty('ear.bundle.war')=='true'}">
|
|
<fileset dir="${maven.repo.local}/${dep.artifactDirectory}/wars/">
|
|
<include name="${dep.artifact}"/>
|
|
</fileset>
|
|
</j:if>
|
|
<j:if test="${dep.getProperty('ear.bundle.ejb')=='true'}">
|
|
<fileset dir="${maven.repo.local}/${dep.artifactDirectory}/ejbs/">
|
|
<include name="${dep.artifact}"/>
|
|
</fileset>
|
|
</j:if>
|
|
</j:forEach>
|
|
|
|
<!-- include license -->
|
|
<j:set var="licenseFileName"><license:fileName/></j:set>
|
|
<util:file name="${licenseFileName}" var="licenseFile"/>
|
|
<metainf dir="${licenseFile.canonicalFile.parent}">
|
|
<include name="${licenseFile.canonicalFile.name}"/>
|
|
</metainf>
|
|
|
|
|
|
<j:if test="${maven.ear.manifest.available}">
|
|
<setProperty name="manifest" value="${maven.ear.manifest}" />
|
|
</j:if>
|
|
|
|
<!-- standard manifest entries -->
|
|
<manifest>
|
|
<attribute name="Built-By" value="${user.name}" />
|
|
<section name="${pom.package}">
|
|
<attribute name="Specification-Title" value="${pom.artifactId}" />
|
|
<attribute name="Specification-Version"
|
|
value="${pom.currentVersion}" />
|
|
<attribute name="Specification-Vendor"
|
|
value="${pom.organization.name}" />
|
|
<attribute name="Implementation-Title"
|
|
value="${pom.package}" />
|
|
<attribute name="Implementation-Version"
|
|
value="${pom.currentVersion}" />
|
|
<attribute name="Implementation-Vendor"
|
|
value="${pom.organization.name}" />
|
|
</section>
|
|
</manifest>
|
|
</ear>
|
|
|
|
</goal>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Install the ear in the local repository -->
|
|
<!--==================================================================-->
|
|
<goal name="ear:install"
|
|
prereqs="ear:ear"
|
|
description="Install the ear in the local repository">
|
|
|
|
<property name="maven.ear.install.dir"
|
|
value="${maven.repo.local}/${pom.artifactDirectory}/ears"/>
|
|
<mkdir dir="${maven.ear.install.dir}"/>
|
|
<copy file="${maven.build.dir}/${maven.final.name}.ear"
|
|
tofile="${maven.ear.install.dir}/${maven.final.name}.ear"/>
|
|
|
|
</goal>
|
|
|
|
</project>
|