o adding support for maven.home.local property ( fix for patch from MAVEN-302 )
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@113399 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<project
|
||||
<project
|
||||
xmlns:j="jelly:core"
|
||||
xmlns:u="jelly:util"
|
||||
xmlns:x="jelly:xml">
|
||||
|
||||
<goal name="plugin" description="Build and install a plugin">
|
||||
<goal name="plugin" description="Build a plugin jar and install to the maven.local.repo">
|
||||
|
||||
<!-- big change. Most plugins are just a jar and have
|
||||
copied the maven.xml to tweak the resources
|
||||
Now it is up to the plugin to define the resources.
|
||||
-->
|
||||
-->
|
||||
<attainGoal name="jar:jar"/>
|
||||
|
||||
<copy file="${maven.build.dir}/${maven.final.name}.jar"
|
||||
@@ -19,47 +19,52 @@
|
||||
</goal>
|
||||
|
||||
<goal name="plugin:install" prereqs="plugin"
|
||||
description="Install the plugin in Maven's plugins dir">
|
||||
description="Install the plugin jar, prepare Maven to expand it locally and clear caches">
|
||||
|
||||
<copy file="${maven.build.dir}/${maven.final.name}.jar"
|
||||
todir="${maven.plugin.dir}"/>
|
||||
todir="${maven.home}/plugins"/>
|
||||
|
||||
<delete includeEmptyDirs="true" verbose="false">
|
||||
<fileset dir="${maven.home}/plugins">
|
||||
<fileset dir="${maven.home.local}/plugins">
|
||||
<include name="*.cache"/>
|
||||
<include name="**/.processed" />
|
||||
<include name="${pom.artifactId}-*/**" />
|
||||
<exclude name="${maven.final.name}.jar" />
|
||||
</fileset>
|
||||
</delete>
|
||||
|
||||
|
||||
</goal>
|
||||
|
||||
<goal name="plugin:deploy" prereqs="plugin"
|
||||
description="Install an unpacked version of the plugin">
|
||||
description="Install a specific unpacked plugin but no new jar">
|
||||
|
||||
<mkdir dir="${maven.home}/plugins/${maven.final.name}"/>
|
||||
<unzip src="${maven.build.dir}/${maven.final.name}.jar"
|
||||
dest="${maven.home}/plugins/${maven.final.name}"/>
|
||||
<mkdir dir="${maven.home.local}/plugins/${maven.final.name}"/>
|
||||
<unzip src="${maven.build.dir}/${maven.final.name}.jar"
|
||||
dest="${maven.home.local}/plugins/${maven.final.name}"/>
|
||||
|
||||
<echo message="" >
|
||||
Warning: Contents of ${maven.home}/plugins/${maven.final.name}.jar does not match
|
||||
the unpacked contents of ${maven.home.local}/plugins/${maven.final.name} directory.
|
||||
</echo>
|
||||
|
||||
</goal>
|
||||
|
||||
|
||||
<!-- generate documentation -->
|
||||
|
||||
|
||||
<!-- generate docs that are usually missing -->
|
||||
<goal name="plugin:generate-docs"
|
||||
<goal name="plugin:generate-docs"
|
||||
description="Generate navigation, goals and properties docs">
|
||||
<attainGoal name="plugin:generate-navigation" />
|
||||
<attainGoal name="plugin:generate-goals" />
|
||||
<attainGoal name="plugin:generate-properties" />
|
||||
</goal>
|
||||
|
||||
|
||||
<!-- generate a skeletal navigation.xml for the plugin specified
|
||||
by the 'plugin' variable -->
|
||||
<goal name="plugin:generate-navigation"
|
||||
description="Generate navigation.xml for the plugin">
|
||||
|
||||
|
||||
<j:set var="skip" value="false" />
|
||||
<j:set var="fileName">${maven.docs.src}/navigation.xml</j:set>
|
||||
<u:available file="${fileName}">
|
||||
@@ -75,18 +80,18 @@
|
||||
</j:file>
|
||||
</j:if>
|
||||
</goal>
|
||||
|
||||
|
||||
<!-- generate a skeletal goals.xml for the plugin specified -->
|
||||
<goal name="plugin:generate-goals"
|
||||
description="Generate goals.xml for the plugin">
|
||||
|
||||
|
||||
<j:set var="skip" value="false" />
|
||||
<j:set var="fileName">${maven.docs.src}/goals.xml</j:set>
|
||||
<u:available file="${fileName}">
|
||||
<echo>Skipping file as '${fileName}' already exists</echo>
|
||||
<j:set var="skip" value="true" />
|
||||
</u:available>
|
||||
|
||||
|
||||
<j:if test="${!skip}">
|
||||
<j:set var="pluginScript" value="false" />
|
||||
<u:available file="${basedir}/plugin.jelly">
|
||||
@@ -94,13 +99,13 @@
|
||||
</u:available>
|
||||
|
||||
<mkdir dir="${maven.docs.src}" />
|
||||
|
||||
|
||||
<j:if test="${!pluginScript}">
|
||||
<!-- no plugin.jelly - generate a file for empty goals -->
|
||||
<echo>Generating 'empty' goals file '${fileName}'</echo>
|
||||
<j:set var="template" value="${plugin.resources}/templates/goals-empty.jelly" />
|
||||
</j:if>
|
||||
|
||||
|
||||
<j:if test="${pluginScript}">
|
||||
<!-- generate docs based on plugin.jelly -->
|
||||
<u:file name="${basedir}/plugin.jelly" var="script" />
|
||||
@@ -115,12 +120,12 @@
|
||||
|
||||
</j:if>
|
||||
</goal>
|
||||
|
||||
|
||||
<!-- generate properties documentation -->
|
||||
<goal name="plugin:generate-properties"
|
||||
description="Generate properties.xml for the plugin">
|
||||
|
||||
|
||||
|
||||
<j:set var="skip" value="false" />
|
||||
<j:set var="fileName">${maven.docs.src}/properties.xml</j:set>
|
||||
<u:available file="${fileName}">
|
||||
@@ -140,7 +145,7 @@
|
||||
<j:set var="template" value="${plugin.resources}/templates/properties-empty.jelly"/>
|
||||
</j:if>
|
||||
|
||||
<j:if test="${props}">
|
||||
<j:if test="${props}">
|
||||
<echo>Generating file '${fileName}'</echo>
|
||||
<j:scope>
|
||||
<u:properties file="${propsFileName}" />
|
||||
@@ -150,11 +155,11 @@
|
||||
</j:if>
|
||||
|
||||
<mkdir dir="${maven.docs.src}" />
|
||||
|
||||
|
||||
<j:file name="${fileName}" prettyPrint="true">
|
||||
<j:import file="${template}" inherit="true"/>
|
||||
</j:file>
|
||||
|
||||
|
||||
</j:if>
|
||||
</goal>
|
||||
</project>
|
||||
|
||||
Reference in New Issue
Block a user