git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@112764 13f79535-47bb-0310-9956-ffa450edef68
91 lines
3.5 KiB
XML
91 lines
3.5 KiB
XML
<?xml version="1.0"?>
|
|
|
|
<project xmlns:j="jelly:core" xmlns:log="jelly:log"
|
|
xmlns:define="jelly:define" >
|
|
|
|
<!-- ================================================================ -->
|
|
<!-- D E F A U L T G O A L -->
|
|
<!-- ================================================================ -->
|
|
<goal name="j2ee" prereqs="j2ee:validate-war"
|
|
description="Check that a war file is valid" />
|
|
|
|
<!-- ================================================================ -->
|
|
<!-- V A L I D A T E A W A R -->
|
|
<!-- ================================================================ -->
|
|
<goal name="j2ee:validate-war"
|
|
description="Check that a war file is valid">
|
|
|
|
<taskdef name="warvalidator" classname="org.apache.maven.j2ee.WarValidator">
|
|
<classpath>
|
|
<pathelement path="${plugin.resources}" />
|
|
<pathelement path="${plugin.getDependencyPath('ant')}"/>
|
|
<pathelement path="${plugin.getDependencyPath('dom4j')}"/>
|
|
<pathelement path="${plugin.getDependencyPath('xml-apis')}"/>
|
|
</classpath>
|
|
</taskdef>
|
|
|
|
<j:set var="warBuildDir"
|
|
value="${pom.getPluginContext('maven-war-plugin').getVariable('maven.war.build.dir')}"/>
|
|
|
|
<warvalidator warFileName="${warBuildDir}/${pom.artifactId}.war">
|
|
<formatter type="plain" usefile="false"/>
|
|
</warvalidator>
|
|
</goal>
|
|
|
|
<!-- ================================================================ -->
|
|
<!-- E A R -->
|
|
<!-- ================================================================ -->
|
|
<goal name="j2ee:ear"
|
|
description="Create an EAR file from the project">
|
|
|
|
<echo>Building EAR ${pom.artifactId}</echo>
|
|
<j:set var="warBuildDir"
|
|
value="${pom.getPluginContext('maven-war-plugin').getVariable('maven.war.build.dir')}"/>
|
|
|
|
<mkdir dir="${warBuildDir}" />
|
|
<ear earfile="${warBuildDir}/${pom.artifactId}.ear"
|
|
appxml="${maven.j2ee.ear.appxml}">
|
|
|
|
<!-- include the actual project files -->
|
|
<fileset dir="${maven.build.dir}"
|
|
includes="${maven.j2ee.ear.includes}"
|
|
excludes="${maven.j2ee.ear.excludes}" />
|
|
|
|
<!-- 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:forEach>
|
|
|
|
<!-- include license -->
|
|
<metainf dir="${basedir}">
|
|
<include name="LICENSE.txt"/>
|
|
</metainf>
|
|
|
|
<!-- standard manifest entries -->
|
|
<!-- fix me - classPath 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>
|
|
|
|
</project>
|