Added dynamic tag library for generation of manifest file

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@113486 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
michal
2003-06-11 21:51:38 +00:00
parent bb6c5b31f2
commit 216479dfa5
3 changed files with 85 additions and 1 deletions

View File

@@ -9,7 +9,47 @@
xmlns:resources="resources"
xmlns:util="jelly:util"
xmlns:doc="doc"
xmlns:m="maven">
xmlns:m="maven"
xmlns:define="jelly:define"
xmlns:velocity="jelly:velocity"
>
<define:taglib uri="manifest">
<!--
|
| @destFile
|
-->
<define:tag name="create-file">
<j:set
var="templatePath"
value="${pom.getPluginContext('maven-jar-plugin').getVariable('plugin.dir')}/plugin-resources/templates"/>
<j:set
var="mainclass"
value="${$pom.getPluginContext('maven-java-plugin').getVariable('maven.jar.mainclass')}"/>
<j:set
var="addExtension"
value="${pom.getPluginContext('maven-jar-plugin').getVariable('${maven.jar.manifest.extensions.add')}"/>
<ant:echo>Creating MANIFEST file:${destFile}</ant:echo>
<velocity:merge
name="${destFile}"
basedir="${templatePath}"
template="manifest.vm"/>
</define:tag>
</define:taglib>
<!-- ================================================================== -->
<!-- J A R -->

View File

@@ -15,4 +15,21 @@
<url>http://cvs.apache.org/viewcvs/maven/src/plugins-build/jar/</url>
</repository>
<developers/>
<dependencies>
<dependency>
<groupId>commons-jelly</groupId>
<artifactId>commons-jelly-tags-velocity</artifactId>
<version>20030303.205659</version>
<properties>
<classloader>root.maven</classloader>
</properties>
</dependency>
<dependency>
<id>velocity</id>
<version>1.3</version>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,27 @@
Built-By="${user.name}
Created-By=Apache Jakarta Maven
Package=${pom.package}
Build-Jdk=${java.version}
Extension-Name=${pom.artifactId}
Specification-Version=${pom.specificationVersion}
Specification-Vendor=${pom.organization.name}
Specification-Title=${pom.shortDescription}
Implementation-Version=${pom.currentVersion}
Implementation-Vendor=${pom.organization.name}
Implementation-Vendor-Id=${pom.organization.identifier}
#if(${mainclass})
Main-Class=${mainclass}
#end
#if( ${addExtension})
#foreach($artifact in $project.artifacts)
#set($extensionList = $artifact.artifactId)
#end
Extension-List ${extensionList}
#foreach($artifact in $project.artifacts)
${dep.artifactId}-Extension-Name${dep.artifactId}
${dep.artifactId}-Implementation-Version${dep.version}
${dep.artifactId}-Implementation-URLhttp://www.ibiblio.org/maven${artifact.urlPath}
#end
#end