git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@112873 13f79535-47bb-0310-9956-ffa450edef68
104 lines
4.0 KiB
XML
104 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 ejb file -->
|
|
<!--==================================================================-->
|
|
<goal name="ejb" prereqs="ejb:ejb" description="Build an ejb file"/>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Initializations -->
|
|
<!--==================================================================-->
|
|
<goal name="ejb:init"
|
|
description="Initialize filesystem and other resources for an ejb build">
|
|
|
|
|
|
<j:if test="${sourcesPresent == 'true'}">
|
|
<attainGoal name="java:compile"/>
|
|
<attainGoal name="test:test"/>
|
|
</j:if>
|
|
|
|
</goal>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Builds an ejb file -->
|
|
<!--==================================================================-->
|
|
<goal name="ejb:ejb" prereqs="ejb:init" description="Build an ejb file">
|
|
|
|
<echo>Building ejb ${maven.final.name}</echo>
|
|
|
|
<available property="maven.ejb.manifest.available"
|
|
file="${maven.ejb.manifest}"/>
|
|
|
|
<j:forEach var="dep" items="${pom.dependencies}">
|
|
<j:if test="${dep.getProperty('ejb.manifest.classpath')=='true'}">
|
|
<j:set var="maven.ejb.classpath" value="${maven.ejb.classpath} ${dep.artifact}"/>
|
|
</j:if>
|
|
</j:forEach>
|
|
|
|
<!-- jar task used for now due to problems with ejb jar not including
|
|
files other than class files -->
|
|
<jar jarfile="${maven.build.dir}/${maven.final.name}.jar">
|
|
|
|
<!-- include marked dependencies -->
|
|
<j:forEach var="dep" items="${pom.dependencies}">
|
|
<j:if test="${dep.getProperty('ejb.bundle.jar')=='true'}">
|
|
<fileset dir="${maven.repo.local}/${dep.artifactDirectory}/jars/">
|
|
<include name="${dep.artifact}"/>
|
|
</fileset>
|
|
</j:if>
|
|
</j:forEach>
|
|
|
|
|
|
<j:if test="${maven.ejb.manifest.available}">
|
|
<setProperty name="manifest" value="${maven.ejb.manifest}" />
|
|
</j:if>
|
|
|
|
<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>
|
|
|
|
<manifest>
|
|
<attribute name="Built-By" value="${user.name}"/>
|
|
<attribute name="Created-By" value="Apache Jakarta Maven"/>
|
|
<attribute name="Package" value="${pom.package}"/>
|
|
<attribute name="Class-Path" value="${maven.ejb.classpath}"/>
|
|
<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>
|
|
|
|
<fileset dir="${maven.ejb.src}"/>
|
|
<fileset dir="${maven.build.dest}"/>
|
|
|
|
</jar>
|
|
|
|
</goal>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Install the ejb in the local repository -->
|
|
<!--==================================================================-->
|
|
<goal name="ejb:install"
|
|
prereqs="ejb:ejb"
|
|
description="Install the ejb in the local repository">
|
|
|
|
<property name="maven.ejb.install.dir"
|
|
value="${maven.repo.local}/${pom.artifactDirectory}/ejbs"/>
|
|
<mkdir dir="${maven.ejb.install.dir}"/>
|
|
<copy file="${maven.build.dir}/${maven.final.name}.jar"
|
|
tofile="${maven.ejb.install.dir}/${maven.final.name}.jar"/>
|
|
|
|
</goal>
|
|
|
|
</project>
|