dion        2003/09/18 02:02:31

  Modified:    src/plugins-build/plugin plugin.jelly
  Log:
  Remove other versions of the same plugin, like plugin:install does
  
  Revision  Changes    Path
  1.18      +22 -2     maven/src/plugins-build/plugin/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/maven/src/plugins-build/plugin/plugin.jelly,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- plugin.jelly      18 Sep 2003 07:39:24 -0000      1.17
  +++ plugin.jelly      18 Sep 2003 09:02:31 -0000      1.18
  @@ -175,21 +175,22 @@
       <maven:param-check value="${artifactId}" fail="true" message="'artifactId' must 
be specified"/>
       <maven:param-check value="${groupId}" fail="true" message="'groupId' must be 
specified"/>
       <maven:param-check value="${version}" fail="true" message="'version' must be 
specified"/>
  +    
       <j:set var="repoList">${maven.repo.remote}</j:set>
       <u:tokenize var="repos" delim=",">${repoList.trim()}</u:tokenize>
  +    
       <j:forEach var="repo" items="${repos}">
         <echo>repo is '${repo}'</echo>
         <u:file var="localPlugin" 
           name="${maven.home}/plugins/${artifactId}-${version}.jar" />
         <j:if test="${!localPlugin.exists()}">
  -        <u:file var="localPluginFile" name="${localPlugin}"/>
           <j:set var="remoteFile"
             value="${repo}/${groupId}/plugins/${artifactId}-${version}.jar" />
           <echo>trying to download ${remoteFile}</echo>
           <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="${localPluginFile}"/>
  +          <j:arg type="java.io.File" value="${localPlugin}"/>
             <j:arg type="boolean" value="false"/>
             <j:arg type="boolean" value="true"/>
             <j:arg type="java.lang.String" value="${maven.proxy.host}" />
  @@ -200,5 +201,24 @@
           </j:invokeStatic>
         </j:if>
       </j:forEach>
  +    
  +    <j:set var="downloaded" value="${localPlugin.exists()}"/>
  +    <j:if test="${downloaded}">
  +      <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>
  +    </j:if>
     </goal>
   </project>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to