Fix plugin:download to not delete the plugin just downloaded!
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@114473 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
1 parent
5f9e553302
commit
e50953ba61
4 files changed
+28
-19
No files matched your search
+10
-19
@@ -187,7 +187,9 @@
|
||||
<echo>repo is '${repo}'</echo>
|
||||
<u:file var="localPlugin"
|
||||
name="${maven.home}/plugins/${artifactId}-${version}.jar" />
|
||||
<j:if test="${!localPlugin.exists()}">
|
||||
<u:file var="localPluginTempFile"
|
||||
name="${maven.home}/plugins/plugin.tmp" />
|
||||
<j:if test="${!localPluginTempFile.exists()}">
|
||||
<j:set var="remoteFile"
|
||||
value="${repo}/${groupId}/plugins/${artifactId}-${version}.jar" />
|
||||
<echo>trying to download ${remoteFile}</echo>
|
||||
@@ -195,7 +197,7 @@
|
||||
<j:invokeStatic var="dummy" method="getFile"
|
||||
className="org.apache.maven.util.HttpUtils">
|
||||
<j:arg type="java.lang.String" value="${remoteFile}" />
|
||||
<j:arg type="java.io.File" value="${localPlugin}"/>
|
||||
<j:arg type="java.io.File" value="${localPluginTempFile}"/>
|
||||
<j:arg type="boolean" value="false"/>
|
||||
<j:arg type="boolean" value="true"/>
|
||||
<j:arg type="java.lang.String" value="${maven.proxy.host}" />
|
||||
@@ -206,30 +208,19 @@
|
||||
</j:invokeStatic>
|
||||
</j:catch>
|
||||
</j:if>
|
||||
<j:break test="${localPlugin.exists()}"/>
|
||||
<j:break test="${localPluginTempFile.exists()}"/>
|
||||
</j:forEach>
|
||||
|
||||
<j:set var="downloaded" value="${localPlugin.exists()}"/>
|
||||
<j:set var="downloaded" value="${localPluginTempFile.exists()}"/>
|
||||
<j:if test="${!downloaded}">
|
||||
<ant:fail message="Unable to find plug-in" />
|
||||
</j:if>
|
||||
<j:if test="${downloaded}">
|
||||
<echo>Plugin downloaded, removing other versions</echo>
|
||||
<echo>Plugin downloaded, removing other versions</echo>\
|
||||
|
||||
<delete verbose="false">
|
||||
<fileset dir="${maven.home}/plugins">
|
||||
<include name="${artifactId}-*.jar" />
|
||||
<exclude name="${artifactId}-${version}.jar" />
|
||||
</fileset>
|
||||
</delete>
|
||||
|
||||
<delete includeEmptyDirs="true" verbose="false">
|
||||
<fileset dir="${maven.plugin.unpacked.dir}">
|
||||
<include name="*.cache"/>
|
||||
<include name="**/.processed" />
|
||||
<include name="${artifactId}-*/**" />
|
||||
</fileset>
|
||||
</delete>
|
||||
<attainGoal name="plugin:uninstall"/>
|
||||
<ant:move file="${localPluginTempFile}"
|
||||
tofile="${localPlugin}" />
|
||||
</j:if>
|
||||
</goal>
|
||||
|
||||
|
||||
Reference in new issue
Block a user