[ https://jira.codehaus.org/browse/MPPLUGIN-31?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Osipov closed MPPLUGIN-31. ---------------------------------- Resolution: Won't Fix Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out. > Add a goal for uninstalling dependancy plugins > ---------------------------------------------- > > Key: MPPLUGIN-31 > URL: https://jira.codehaus.org/browse/MPPLUGIN-31 > Project: Maven 1.x Plugin Plugin > Issue Type: Wish > Environment: Linux > Reporter: Eric Black > Priority: Minor > > I was having a problem with devising a plan for developers in my group to > automatically install plugins, and through the user group mailing list, I got > some help getting it to work. The following is the last email I sent > regarding auto uninstalling the plugins to get a newer version: > I used the dependency method, which I found to be much superior to > plugin:download or plugin:install since a user may not have permissions to > install a plugin into the MAVEN_HOME/plugins directory. With the dependency > method, I found it difficult to upgrade the plugin unless I manually deleted > what was installed or specified SNAPSHOT as the version. After reading some > older mailings(specifically between Ben Gridley and Brett Porter), I used > modified Ben's script as follows: > <?xml version="1.0"?> > <project > xmlns:j="jelly:core" > xmlns:ant="jelly:ant"> > <goal name="ccplugin:delete"> > <j:forEach var="dep" items="${pom.dependencies}"> > <j:if test="${dep.type =='plugin'}"> > <!-- > <maven:get plugin="${dep.artifactId}" property="plugin" var="plugin" > /> > --> > <!-- Clean out the cache files --> > <attainGoal name="plugin:uninstall" /> > > <!-- Set the variables --> > <j:set var="groupId" value="${dep.groupId}"/> > <j:set var="artifactId" value="${dep.artifactId}"/> > <j:set var="version" value="${dep.version}"/> > <j:set var="pluginname" value="${artifactId}-${version}"/> > > <!-- Check if the plugin is in the main maven plugins directory --> > <ant:available property="mainplugin" > file="${maven.plugin.dir}/${pluginname}.jar" /> > <j:if test="${mainplugin == 'true'}"> > <ant:echo message="${maven.plugin.dir}/${pluginname}.jar is in the > main maven plugins directory" /> > <!-- This is kindof dangerous as it would effect all users and may > fail if not owned by the user --> > <ant:delete file="${maven.plugin.dir}/${pluginname}.jar" />" > </j:if> > <!-- Remove from the user's plugin directory. --> > <ant:available property="userplugin" > file="${maven.plugin.user.dir}/${pluginname}.jar" /> > <j:if test="${userplugin == 'true'}"> > <ant:echo message="Removing '${pluginname}' from > '${maven.plugin.dir}'" /> > <ant:delete file="${maven.plugin.user.dir}/${pluginname}.jar" />" > </j:if> > <!-- Remove from the user's cache directory. This isn't really > necessary since we'll delete > the jar in the repository which will cause the plugin to be > re-downloaded --> > <ant:available property="usercache" > file="${maven.plugin.unpacked.dir}/${pluginname}" /> > <j:if test="${usercache == 'true'}"> > <ant:echo message="Removing ${pluginname} from > ${maven.plugin.unpacked.dir}" /> > <ant:delete dir="${maven.plugin.unpacked.dir}/${pluginname}" > includeEmptyDirs="true" /> > </j:if> > <!-- Remove from the user's repository directory. --> > <ant:available property="userrepoplugin" > file="${maven.repo.local}/${groupId}/plugins/${pluginname}.jar" /> > <j:if test="${userrepoplugin == 'true'}"> > <ant:echo message="Removing '${pluginname}' from > '${maven.repo.local}'" /> > <ant:delete > file="${maven.repo.local}/${groupId}/plugins/${pluginname}.jar" /> > </j:if> > </j:if> > </j:forEach> > </goal> > </project> > I think this kind of functionality might be useful in the main Maven plugin > plugin. -- This message was sent by Atlassian JIRA (v6.1.6#6162)