brett 2004/03/01 16:17:25 Modified: plugin plugin.jelly plugin/xdocs changes.xml Log: split plugin:download goal Revision Changes Path 1.30 +19 -22 maven-plugins/plugin/plugin.jelly Index: plugin.jelly =================================================================== RCS file: /home/cvs/maven-plugins/plugin/plugin.jelly,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- plugin.jelly 26 Feb 2004 16:26:59 -0000 1.29 +++ plugin.jelly 2 Mar 2004 00:17:24 -0000 1.30 @@ -175,22 +175,26 @@ </j:if> </goal> + <goal name="plugin:download" description="download and install a plugin from a remote repo" prereqs="plugin:download-artifact"> + <attainGoal name="plugin:uninstall"/> + <u:file var="localPlugin" name="${maven.home}/plugins/${artifactId}-${version}.jar" /> + <ant:copy file="${localPluginFile}" tofile="${localPlugin}" /> + </goal> + <!-- download a plugin from a remote repo --> - <goal name="plugin:download" description="download a plugin from a remote repo"> + <goal name="plugin:download-artifact" description="download a plugin from a remote repo"> <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> + <u:file var="localPluginFile" + name="${maven.repo.local}/${groupId}/plugins/${artifactId}-${version}.jar" /> + <j:if test="${!localPluginFile.exists()}"> + <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" /> - <u:file var="localPluginTempFile" - name="${maven.home}/plugins/plugin.tmp" /> - <j:if test="${!localPluginTempFile.exists()}"> + <j:forEach var="repo" items="${repos}"> + <echo>repo is '${repo}'</echo> <j:set var="remoteFile" value="${repo}/${groupId}/plugins/${artifactId}-${version}.jar" /> <echo>trying to download ${remoteFile}</echo> @@ -198,7 +202,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="${localPluginTempFile}"/> + <j:arg type="java.io.File" value="${localPluginFile}"/> <j:arg type="boolean" value="false"/> <j:arg type="boolean" value="true"/> <j:arg type="java.lang.String" value="${maven.proxy.host}" /> @@ -208,20 +212,13 @@ <j:arg type="boolean" value="false"/> </j:invokeStatic> </j:catch> - </j:if> - <j:break test="${localPluginTempFile.exists()}"/> - </j:forEach> + <j:break test="${localPluginFile.exists()}"/> + </j:forEach> + </j:if> - <j:set var="downloaded" value="${localPluginTempFile.exists()}"/> + <j:set var="downloaded" value="${localPluginFile.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>\ - - <attainGoal name="plugin:uninstall"/> - <ant:move file="${localPluginTempFile}" - tofile="${localPlugin}" /> </j:if> </goal> 1.11 +4 -0 maven-plugins/plugin/xdocs/changes.xml Index: changes.xml =================================================================== RCS file: /home/cvs/maven-plugins/plugin/xdocs/changes.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- changes.xml 25 Feb 2004 22:39:29 -0000 1.10 +++ changes.xml 2 Mar 2004 00:17:25 -0000 1.11 @@ -26,6 +26,10 @@ <action dev="brett" type="add"> Add plugin:repository-deploy goal </action> + <action dev="brett" type="update"> + Split plugin:download goal into plugin:download-artifact goal and the original goal that downloads + and installs the plugin. Download to local repository as well. + </action> </release> <release version="1.1" date="2003-09-29">
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]