- Make the ejb creation work even if there are not sources. git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@233477 13f79535-47bb-0310-9956-ffa450edef68
286 lines
11 KiB
XML
286 lines
11 KiB
XML
<?xml version="1.0"?>
|
|
|
|
<!--
|
|
/*
|
|
* Copyright 2001-2005 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">
|
|
|
|
<j:new var="ejbTypeHandler" className="org.apache.maven.ejb.EJBArtifactTypeHandler" />
|
|
|
|
<!--==================================================================-->
|
|
<!-- Default goal : Builds ejb files -->
|
|
<!--==================================================================-->
|
|
<goal name="ejb" prereqs="ejb:ejb"
|
|
description="Build ejb-jar and ejb-client files">
|
|
</goal>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Initializations -->
|
|
<!--==================================================================-->
|
|
<goal name="ejb:init">
|
|
|
|
<!-- This is required in the case of building an ejb jar where all
|
|
the sources are taken from a dependent jar. When this is the case
|
|
the source files have not been compiled and the classes dir thus
|
|
not created automatically -->
|
|
<ant:mkdir dir="${maven.build.dest}"/>
|
|
|
|
<j:choose>
|
|
<j:when test="${sourcesPresent == 'true'}">
|
|
<attainGoal name="test:test"/>
|
|
</j:when>
|
|
<j:otherwise>
|
|
<!-- Make sure we always copy the resources whether there are sources or
|
|
not -->
|
|
<attainGoal name="java:jar-resources"/>
|
|
</j:otherwise>
|
|
</j:choose>
|
|
|
|
</goal>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Builds ejb files -->
|
|
<!--==================================================================-->
|
|
<goal name="ejb:ejb" prereqs="ejb:init"
|
|
description="Build ejb-jar and ejb-client files">
|
|
|
|
<attainGoal name="ejb:ejb-jar-internal"/>
|
|
<j:if test="${context.getVariable('maven.ejb.client.generate') == 'true'}">
|
|
<attainGoal name="ejb:ejb-client-internal"/>
|
|
</j:if>
|
|
|
|
</goal>
|
|
|
|
<goal name="ejb:ejb-jar-internal">
|
|
|
|
<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>
|
|
|
|
<goal name="ejb:ejb-client-internal">
|
|
|
|
<ant:jar jarfile="${maven.ejb.build.dir}/${maven.ejb.client.final.name}"
|
|
basedir="${maven.build.dest}"
|
|
excludes="${maven.ejb.client.base.excludes},${maven.ejb.client.excludes}"
|
|
index="${maven.ejb.client.index}"/>
|
|
|
|
</goal>
|
|
|
|
<goal name="ejb:ejb-client" prereqs="ejb:ejb" description="Build a client ejb file">
|
|
|
|
<echo>DEPRECATED: You should use the ejb:ejb goal instead which automatically creates an ejb-client jar too.</echo>
|
|
<attainGoal name="ejb:ejb-client-internal"/>
|
|
|
|
</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">
|
|
|
|
<echo>DEPRECATED: You should use the ejb:install goal instead which automatically installs the ejb-client jar too.</echo>
|
|
|
|
<artifact:install
|
|
artifact="${maven.ejb.build.dir}/${maven.ejb.client.final.name}"
|
|
type="ejb-client"
|
|
project="${pom}"
|
|
typeHandler="${ejbTypeHandler}"/>
|
|
|
|
</goal>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Install the ejbs in the local repository -->
|
|
<!--==================================================================-->
|
|
<goal name="ejb:install"
|
|
prereqs="ejb:ejb"
|
|
description="Install the ejb files in the local repository">
|
|
|
|
<artifact:install
|
|
artifact="${maven.ejb.build.dir}/${maven.ejb.final.name}"
|
|
type="ejb"
|
|
project="${pom}"
|
|
typeHandler="${ejbTypeHandler}"/>
|
|
<j:if test="${context.getVariable('maven.ejb.client.generate') == 'true'}">
|
|
<artifact:install
|
|
artifact="${maven.ejb.build.dir}/${maven.ejb.client.final.name}"
|
|
type="ejb-client"
|
|
project="${pom}"
|
|
typeHandler="${ejbTypeHandler}"/>
|
|
</j:if>
|
|
|
|
</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}"
|
|
typeHandler="${ejbTypeHandler}"/>
|
|
|
|
</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}"
|
|
typeHandler="${ejbTypeHandler}"/>
|
|
<j:if test="${context.getVariable('maven.ejb.client.generate') == 'true'}">
|
|
<artifact:deploy
|
|
artifact="${maven.ejb.build.dir}/${maven.ejb.client.final.name}"
|
|
type="ejb-client"
|
|
project="${pom}"
|
|
typeHandler="${ejbTypeHandler}"/>
|
|
</j:if>
|
|
|
|
</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}"
|
|
typeHandler="${ejbTypeHandler}"/>
|
|
|
|
</goal>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Deploys the ejbs to the remote repository -->
|
|
<!--==================================================================-->
|
|
<goal name="ejb:deploy-client"
|
|
prereqs="ejb:ejb-client"
|
|
description="Deploys the ejb client to the remote repository">
|
|
|
|
<echo>DEPRECATED: You should use the ejb:deploy goal instead which automatically deploys the ejb-client jar too.</echo>
|
|
|
|
<artifact:deploy
|
|
artifact="${maven.ejb.build.dir}/${maven.ejb.client.final.name}"
|
|
type="ejb-client"
|
|
project="${pom}"
|
|
typeHandler="${ejbTypeHandler}"/>
|
|
|
|
</goal>
|
|
|
|
</project>
|