Start of work on a maven plugin:download.

See MAVEN-536


git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@113776 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
dion 2003-08-04 02:32:35 +00:00
parent 3e02e85271
commit 64c2c35ad0
2 changed files with 34 additions and 0 deletions

View File

@ -1,7 +1,9 @@
<?xml version="1.0"?>
<project
xmlns:http="jelly:http"
xmlns:j="jelly:core"
xmlns:maven="jelly:maven"
xmlns:u="jelly:util"
xmlns:x="jelly:xml">
@ -159,4 +161,24 @@
</j:if>
</goal>
<!-- download a plugin from a remote repo -->
<goal name="plugin:download">
<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()}">
<j:set var="remoteFile"
value="${repo}/${groupId}/jars/${artifactId}-${version}.jar" />
<echo>trying to download ${remoteFile}</echo>
<http:get uri="${remoteFile}" var="outputVar" />
</j:if>
</j:forEach>
</goal>
</project>

View File

@ -41,5 +41,17 @@
<version>20030211.142705</version>
<url>http://jakarta.apache.org/commons/jelly/libs/xml/</url>
</dependency>
<dependency>
<groupId>commons-jelly</groupId>
<artifactId>commons-jelly-tags-http</artifactId>
<version>20030211.143043</version>
<url>http://jakarta.apache.org/commons/jelly/libs/http/</url>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>2.0-rc1</version>
<url>http://jakarta.apache.org/commons/httpclient/</url>
</dependency>
</dependencies>
</project>