maven-plugins/ejb/plugin.jelly
vmassol 30a1422cbb - Added new <code>maven.ejb.build.dir</code> property that specifies the location where the EJBs are generated.
- Modified existing <code>maven.ejb.final.name</code> property (and exposed it as a public property) so that it doesn't include the path (the path is now provided by the new <code>maven.ejb.build.dir</code> property). This allows aligning the WAR and EJB plugin properties. Note: This is a breaking change for all those using the <code>maven.ejb.final.name</code> property (which was not a public property).
- Made the <code>maven.ejb.final.name</code> property public as it is required by several other plugins and before this change the only way is for these plugins was to call the non-public <code>ejb:init</code> goal.


git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@115829 13f79535-47bb-0310-9956-ffa450edef68
2004-07-15 10:08:14 +00:00

231 lines
8.9 KiB
XML

<?xml version="1.0"?>
<!--
/*
* 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.
*/
-->
<project xmlns:j="jelly:core"
xmlns:ant="jelly:ant"
xmlns:license="license"
xmlns:util="jelly:util"
xmlns:artifact="artifact">
<!--==================================================================-->
<!-- Default goal : Builds a ejb file -->
<!--==================================================================-->
<goal name="ejb" prereqs="ejb:ejb" description="Build an ejb file"/>
<!--==================================================================-->
<!-- Initializations -->
<!--==================================================================-->
<goal name="ejb:init">
<j:if test="${sourcesPresent == 'true'}">
<attainGoal name="test:test"/>
</j:if>
</goal>
<!--==================================================================-->
<!-- Builds an ejb file -->
<!--==================================================================-->
<goal name="ejb:ejb" prereqs="ejb:init" description="Build an ejb file">
<ant:echo>Building ejb ${maven.final.name}</ant:echo>
<ant: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 -->
<ant:jar
jarfile="${maven.ejb.build.dir}/${maven.ejb.final.name}"
index="${maven.ejb.index}">
<!-- include marked dependencies -->
<j:forEach var="lib" items="${pom.artifacts}">
<j:set var="dep" value="${lib.dependency}"/>
<!-- Just include jars-->
<!-- Probably we should also include uberjars -->
<j:if test="${dep.getProperty('ejb.bundle')=='true' and dep.type=='jar'}">
<ant:echo>Bundling: ${dep.type} - ${dep.id}</ant:echo>
<ant:fileset dir="${lib.file.parent}">
<ant:include name="${lib.file.name}"/>
</ant:fileset>
</j:if>
<!-- TO BE REMOVED -->
<j:if test="${dep.getProperty('ejb.bundle.jar')=='true'}">
<ant:echo>
<ant:echo>Bundling: ${dep.type} - ${dep.id}</ant:echo>
DEPRECATION WARNING:
Use : ejb.bundle instead of ejb.bundle.jar
</ant:echo>
<ant:fileset dir="${lib.file.parent}">
<ant:include name="${lib.file.name}"/>
</ant:fileset>
</j:if>
<!-- END OF TO BE REMOVED -->
</j:forEach>
<j:if test="${maven.ejb.manifest.available}">
<ant:setProperty name="manifest" value="${maven.ejb.manifest}" />
</j:if>
<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>
<ant:manifest>
<ant:attribute name="Built-By" value="${user.name}"/>
<ant:attribute name="Created-By" value="Apache Maven"/>
<ant:attribute name="Package" value="${pom.package}"/>
<j:set var="classPath" value="${maven.ejb.classpath}"/>
<j:if test="${!empty(classPath)}">
<ant:attribute name="Class-Path" value="${maven.ejb.classpath}"/>
</j:if>
<ant:section name="${pom.package}">
<ant:attribute name="Specification-Title" value="${pom.artifactId}"/>
<ant:attribute name="Specification-Vendor" value="${pom.organization.name}"/>
<!--
<ant:attribute name="Specification-Version" value="${pom.currentVersion}"/>
-->
<ant:attribute name="Implementation-Title" value="${pom.package}"/>
<ant:attribute name="Implementation-Vendor" value="${pom.organization.name}"/>
<ant:attribute name="Implementation-Version" value="${pom.currentVersion}"/>
</ant:section>
</ant:manifest>
<util:available file="${maven.ejb.src}">
<ant:fileset dir="${maven.ejb.src}"/>
</util:available>
<ant:fileset dir="${maven.build.dest}"
includes="${maven.ejb.includes}"
excludes="${maven.ejb.excludes}">
</ant:fileset>
</ant:jar>
</goal>
<!--==================================================================-->
<!-- Builds an ejb client jar file -->
<!--==================================================================-->
<goal name="ejb:ejb-client" prereqs="ejb:ejb" description="Build a client ejb file">
<ant:jar jarfile="${maven.ejb.build.dir}/${maven.final.name}-client.jar"
basedir="${maven.build.dest}"
excludes="${maven.ejb.client.base.excludes},${maven.ejb.client.excludes}"
index="${maven.ejb.client.index}"
>
</ant:jar>
</goal>
<!--==================================================================-->
<!-- Install the ejb client in the local repository -->
<!--==================================================================-->
<goal name="ejb:install-client"
prereqs="ejb:ejb-client"
description="Install the ejb client in the local repository">
<artifact:install
artifact="${maven.ejb.build.dir}/${maven.final.name}-client.jar"
type="jar"
project="${pom}"/>
</goal>
<!--==================================================================-->
<!-- Install the ejb in the local repository -->
<!--==================================================================-->
<goal name="ejb:install"
prereqs="ejb:ejb"
description="Install the ejb in the local repository">
<artifact:install
artifact="${maven.ejb.build.dir}/${maven.ejb.final.name}"
type="ejb"
project="${pom}"/>
</goal>
<!--==================================================================-->
<!-- Install the snapshot version of the ejb in the local repository -->
<!--==================================================================-->
<goal name="ejb:install-snapshot"
prereqs="ejb:ejb"
description="Install the snapshot version of the ejb in the local repository">
<artifact:install-snapshot
artifact="${maven.ejb.build.dir}/${maven.ejb.final.name}"
type="ejb"
project="${pom}"/>
</goal>
<!--==================================================================-->
<!-- Deploys the ejb to the remote repository -->
<!--==================================================================-->
<goal name="ejb:deploy"
prereqs="ejb:ejb"
description="Deploys the ejb to the remote repository">
<artifact:deploy
artifact="${maven.ejb.build.dir}/${maven.ejb.final.name}"
type="ejb"
project="${pom}"/>
</goal>
<!--==================================================================-->
<!-- Deploys the snapshot of the ejb to the remote repository -->
<!--==================================================================-->
<goal name="ejb:deploy-snapshot"
prereqs="ejb:ejb"
description="Deploys the snapshot version of the ejb to remote repository">
<artifact:deploy-snapshot
artifact="${maven.ejb.build.dir}/${maven.ejb.final.name}"
type="ejb"
project="${pom}"/>
</goal>
<!--==================================================================-->
<!-- Deploys the ejb to the remote repository -->
<!--==================================================================-->
<goal name="ejb:deploy-client"
prereqs="ejb:ejb-client"
description="Deploys the ejb client to the remote repository">
<artifact:deploy
artifact="${maven.ejb.build.dir}/${maven.final.name}-client.jar"
type="jar"
project="${pom}"/>
</goal>
</project>