mcconnell 2003/11/20 14:19:20
Modified: meta maven.xml
meta/plugin plugin.jelly project.xml
Log:
Remove repository related content from the meta plugin and bump version.
Revision Changes Path
1.4 +80 -2 avalon/meta/maven.xml
Index: maven.xml
===================================================================
RCS file: /home/cvs/avalon/meta/maven.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- maven.xml 12 Nov 2003 04:46:52 -0000 1.3
+++ maven.xml 20 Nov 2003 22:19:20 -0000 1.4
@@ -1,6 +1,10 @@
<project default="avalon:plugin" xmlns:maven="jelly:maven" xmlns:j="jelly:core"
xmlns:util="jelly:util" xmlns:ant="jelly:ant">
- <ant:property name="meta.plugin.version" value="1.2-SNAPSHOT"/>
+ <ant:property name="meta.plugin.version" value="1.2"/>
+ <ant:property name="meta.plugin.groupId" value="avalon-meta"/>
+ <ant:property name="meta.plugin.artifactId" value="avalon-meta-plugin"/>
+ <ant:property name="meta.plugin.jar"
+ value="${meta.plugin.artifactId}-${meta.plugin.version}.jar"/>
<ant:property name="maven.ui.banner.background" value="#fff"/>
<ant:property name="maven.ui.banner.foreground" value="#000"/>
@@ -97,7 +101,9 @@
<goal name="avalon:dist" prereqs="avalon:plugin,avalon:site,xdist"/>
- <goal name="avalon:site" prereqs="avalon:build">
+ <goal name="avalon:site" prereqs="avalon:build,xsite"/>
+
+ <goal name="xsite">
<ant:mkdir dir="${maven.build.dir}"/>
<maven:reactor
basedir="${basedir}"
@@ -107,6 +113,7 @@
ignoreFailures="false"/>
</goal>
+
<goal name="xjavadoc">
<mkdir dir="${basedir}/target/docs/api" />
<property name="copyright"
@@ -267,6 +274,77 @@
<ant:zipfileset dir="${maven.dist.src.archive.dir}"/>
</ant:zip>
+ </goal>
+
+ <postGoal name="java:prepare-filesystem">
+ <ant:available file="${maven.home}/plugins/${meta.plugin.jar}"
+ property="metaPluginPresent"/>
+ <j:if test="${metaPluginPresent != 'true'}">
+ <ant:echo>
+#####################################################################
+# #
+# WARNING: #
+# You do not have the required version of the avalon-meta #
+# plugin installed on your system. #
+# Please invoke the following command #
+# #
+# $ maven avalon:setup #
+# #
+#####################################################################</ant:echo>
+ <attainGoal name="avalon:repo-plugin-install"/>
+ </j:if>
+ </postGoal>
+
+ <goal name="avalon:setup">
+ <echo>
+Initiating download and installation of the Avalon Meta Plugin.
+${meta.plugin.artifactId}-${meta.plugin.version}.jar</echo>
+ <j:set var="repoList">${maven.repo.remote}</j:set>
+ <util:tokenize var="repos" delim=",">${repoList.trim()}</util:tokenize>
+ <j:forEach var="repo" items="${repos}">
+ <echo>repository '${repo}'</echo>
+ <util:file var="localPlugin"
name="${maven.home}/plugins/${meta.plugin.artifactId}-${meta.plugin.version}.jar" />
+ <j:if test="${!localPlugin.exists()}">
+ <j:set var="remoteFile"
value="${repo}/${meta.plugin.groupId}/plugins/${meta.plugin.artifactId}-${meta.plugin.version}.jar"
/>
+ <echo>trying to download ${remoteFile}</echo>
+ <j:catch var="ex">
+ <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="boolean" value="false"/>
+ <j:arg type="boolean" value="true"/>
+ <j:arg type="java.lang.String" value="${maven.proxy.host}" />
+ <j:arg type="java.lang.String" value="${maven.proxy.port}" />
+ <j:arg type="java.lang.String" value="${maven.proxy.username}" />
+ <j:arg type="java.lang.String" value="${maven.proxy.password}" />
+ <j:arg type="boolean" value="false"/>
+ </j:invokeStatic>
+ </j:catch>
+ </j:if>
+ <j:break test="${localPlugin.exists()}"/>
+ </j:forEach>
+ <j:set var="downloaded" value="${localPlugin.exists()}"/>
+ <j:if test="${!downloaded}">
+ <ant:fail message="Unable to find plug-in" />
+ </j:if>
+ <j:if test="${downloaded}">
+ <ant:move file="${localPlugin}" toFile="tmp.jar"/>
+ <echo>Plugin downloaded, removing other versions</echo>
+ <delete verbose="false">
+ <fileset dir="${maven.home}/plugins">
+ <include name="${meta.plugin.artifactId}-*.jar" />
+ <exclude name="${meta.plugin.artifactId}-${meta.plugin.version}.jar" />
+ </fileset>
+ </delete>
+ <delete includeEmptyDirs="true" verbose="false">
+ <fileset dir="${maven.plugin.unpacked.dir}">
+ <include name="*.cache"/>
+ <include name="**/.processed" />
+ <include name="${meta.plugin.artifactId}-*/**" />
+ </fileset>
+ </delete>
+ <ant:move file="tmp.jar" toFile="${localPlugin}"/>
+ </j:if>
</goal>
</project>
1.8 +0 -101 avalon/meta/plugin/plugin.jelly
Index: plugin.jelly
===================================================================
RCS file: /home/cvs/avalon/meta/plugin/plugin.jelly,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- plugin.jelly 18 Nov 2003 15:32:05 -0000 1.7
+++ plugin.jelly 20 Nov 2003 22:19:20 -0000 1.8
@@ -66,105 +66,4 @@
</goal>
- <!--
- #
- # Write out an artifact descriptor for the projects jar file.
- #
- -->
- <goal name="avalon:artifact">
-
- <maven:snapshot project="${pom}"/>
-
- <ant:property name="filename"
-
value="${maven.build.dir}/${pom.artifactId}-${pom.currentVersion}.jar.meta"/>
- <ant:echo message="Artifact: ${filename}"/>
- <j:set var="offset" value="${pom.artifactId.length()}"/>
- <j:set var="scrap"
- value="${snapshotSignature.substring(offset,snapshotSignature.length())}"/>
- <j:set var="signature" value="${scrap.substring(1,scrap.length())}"/>
- <ant:echo file="${filename}">
-#
-# Meta classifier.
-#
-
-meta.domain = avalon
-meta.domain.classifier = artifact
-meta.domain.classifier.version = 1.0
-
-#
-# Artifact descriptor.
-#
-
-avalon.artifact.group = ${pom.groupId}
-avalon.artifact.name = ${pom.artifactId}
-avalon.artifact.version = ${pom.currentVersion}
-avalon.artifact.signature = ${signature}
-</ant:echo>
- <j:set var="index" value="0"/>
- <j:forEach var="dep" items="${pom.dependencies}">
- <j:set var="key" value="${dep.groupId}:${dep.artifactId};${dep.version}"/>
- <j:if test="${dep.getProperty('avalon.classloader')=='api'}">
- <j:if test="${index==0}">
- <ant:echo file="${filename}" append="true">
-#
-# API dependencies.
-#
-</ant:echo>
- </j:if>
- <ant:echo file="${filename}" append="true">
-avalon.artifact.dependency.api.${index} = ${key}</ant:echo>
- <j:set var="index" value="${index+1}"/>
- </j:if>
- </j:forEach>
-
- <j:set var="index" value="0"/>
- <j:forEach var="dep" items="${pom.dependencies}">
- <j:set var="key" value="${dep.groupId}:${dep.artifactId};${dep.version}"/>
- <j:if test="${dep.getProperty('avalon.classloader')=='spi'}">
- <j:if test="${index==0}">
- <ant:echo file="${filename}" append="true">
-
-#
-# SPI dependencies.
-#
-</ant:echo>
- </j:if>
- <ant:echo file="${filename}" append="true">
-avalon.artifact.dependency.spi.${index} = ${key}</ant:echo>
- <j:set var="index" value="${index+1}"/>
- </j:if>
- </j:forEach>
-
- <j:set var="index" value="0"/>
- <j:forEach var="dep" items="${pom.dependencies}">
- <j:set var="key" value="${dep.groupId}:${dep.artifactId};${dep.version}"/>
- <j:if test="${dep.getProperty('avalon.classloader')==null}">
- <j:if test="${index==0}">
- <ant:echo file="${filename}" append="true">
-
-#
-# Implementation dependencies.
-#
-</ant:echo>
- </j:if>
- <ant:echo file="${filename}" append="true">
-avalon.artifact.dependency.${index} = ${key}</ant:echo>
- <j:set var="index" value="${index+1}"/>
- </j:if>
- </j:forEach>
-
- <ant:echo file="${filename}" append="true">
-</ant:echo>
-
- <ant:property name="avalonArtifactDestination"
- value="${maven.repo.local}/${pom.artifactDirectory}/jars"/>
- <ant:mkdir dir="${avalonArtifactDestination}"/>
- <ant:copy
- file="${filename}"
- todir="${avalonArtifactDestination}"
- overwrite="true"
- />
-
- </goal>
-
</project>
1.6 +1 -1 avalon/meta/plugin/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/avalon/meta/plugin/project.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- project.xml 19 Oct 2003 06:09:32 -0000 1.5
+++ project.xml 20 Nov 2003 22:19:20 -0000 1.6
@@ -5,7 +5,7 @@
<pomVersion>3</pomVersion>
<id>avalon-meta-plugin</id>
<name>Avalon Meta Plugin</name>
- <currentVersion>1.2-SNAPSHOT</currentVersion>
+ <currentVersion>1.2</currentVersion>
<description>Avalon Plugin for Maven</description>
<shortDescription>Avalon Plugin for Maven</shortDescription>
<package>org.apache.avalon</package>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]