PR: MPPLUGIN-12

make uninstall delete the correct plugin when running plugin:download


git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@114842 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
brett
2004-03-08 22:26:11 +00:00
parent 3039d79877
commit 0a4e07c704
3 changed files with 32 additions and 18 deletions

View File

@@ -19,6 +19,7 @@
<project
xmlns:plugin="plugin"
xmlns:ant="jelly:ant"
xmlns:j="jelly:core"
xmlns:maven="jelly:maven"
@@ -38,9 +39,11 @@
</goal>
<goal name="plugin:install" prereqs="plugin,plugin:uninstall"
<goal name="plugin:install" prereqs="plugin"
description="Install the plugin jar, prepare Maven to expand it locally and clear caches">
<plugin:uninstall name="${pom.artifactId}" />
<copy file="${maven.build.dir}/${maven.final.name}.jar"
todir="${maven.home}/plugins"/>
@@ -48,23 +51,10 @@
<goal name="plugin:uninstall"
description="Uninstall all versions of the plugin">
<delete verbose="false" failonerror="false">
<fileset dir="${maven.home}/plugins">
<include name="${pom.artifactId}-*.jar" />
</fileset>
</delete>
<delete includeEmptyDirs="true" verbose="false" failonerror="false">
<fileset dir="${maven.plugin.unpacked.dir}">
<include name="*.cache"/>
<include name="**/.processed" />
<include name="${pom.artifactId}-*/**" />
</fileset>
</delete>
<plugin:uninstall name="${pom.artifactId}" />
</goal>
<goal name="plugin:deploy" prereqs="plugin"
description="Install a specific unpacked plugin but no new jar">
@@ -194,7 +184,7 @@
</goal>
<goal name="plugin:download" description="download and install a plugin from a remote repo" prereqs="plugin:download-artifact">
<attainGoal name="plugin:uninstall"/>
<plugin:uninstall name="${artifactId}" />
<u:file var="localPlugin" name="${maven.home}/plugins/${artifactId}-${version}.jar" />
<ant:copy file="${localPluginFile}" tofile="${localPlugin}" />
</goal>
@@ -266,6 +256,24 @@
/>
</goal>
<define:taglib uri="plugin">
<define:tag name="uninstall">
<ant:delete verbose="false" failonerror="false">
<ant:fileset dir="${maven.home}/plugins">
<ant:include name="${name}-*.jar" />
</ant:fileset>
</ant:delete>
<ant:delete includeEmptyDirs="true" verbose="false" failonerror="false">
<ant:fileset dir="${maven.plugin.unpacked.dir}">
<ant:include name="*.cache"/>
<ant:include name="**/.processed" />
<ant:include name="${name}-*/**" />
</ant:fileset>
</ant:delete>
</define:tag>
</define:taglib>
<define:taglib uri="assert">
<define:tag name="assertFileExists">
<!-- @file : Full file path -->