You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jd...@apache.org on 2008/11/25 00:55:28 UTC
svn commit: r720356 - /maven/components/branches/maven-2.0.x/build.xml
Author: jdcasey
Date: Mon Nov 24 15:55:28 2008
New Revision: 720356
URL: http://svn.apache.org/viewvc?rev=720356&view=rev
Log:
adding set-temp-maven-home target to use a temporary location for maven.home, to help CI builds to succeed when operating system details can vary.
Modified:
maven/components/branches/maven-2.0.x/build.xml
Modified: maven/components/branches/maven-2.0.x/build.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/build.xml?rev=720356&r1=720355&r2=720356&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.x/build.xml (original)
+++ maven/components/branches/maven-2.0.x/build.xml Mon Nov 24 15:55:28 2008
@@ -21,10 +21,11 @@
<property name="it.workdir.version" value="2.0.x"/>
- <target name="initTaskDefs">
+ <target name="initTaskDefs" unless="taskdefs.inited">
<xmlproperty file="pom.xml" prefix="pom.xml" />
<path id="maven-ant-tasks.classpath" path="maven-ant-tasks-2.0.8.jar"/>
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant" classpathref="maven-ant-tasks.classpath"/>
+ <property name="taskdefs.inited" value="true"/>
</target>
<target name="isMavenHomeSet" depends="initTaskDefs">
@@ -35,6 +36,14 @@
<fail unless="maven.home" message="You must set the M2_HOME environment variable or specify a maven.home property to this Ant script"/>
</target>
+ <target name="read-pom" depends="initTaskDefs" unless="pom.version">
+ <copy file="pom.xml" tofile="dependencies.xml"/>
+ <replace file="${basedir}/dependencies.xml" token="<!--start-->" value="<!--"/>
+ <replace file="${basedir}/dependencies.xml" token="<!--end-->" value="-->"/>
+ <artifact:pom file="${basedir}/dependencies.xml" id="pom"/>
+ <delete file="${basedir}/dependencies.xml"/>
+ </target>
+
<target name="init" depends="isMavenHomeSet">
<xmlproperty prefix="pom" file="pom.xml"/>
<basename file="${maven.home}" property="maven.home.basename"/>
@@ -46,21 +55,16 @@
<delete dir="bootstrap"/>
</target>
- <target name="pull" depends="init" unless="skip.pull">
+ <target name="pull" depends="init, read-pom" unless="skip.pull">
<property name="verbose" value="false"/>
<property name="bootstrap.repository" value="${basedir}/bootstrap-repository"/>
<!-- Pull the dependencies that Maven needs to build -->
- <copy file="pom.xml" tofile="dependencies.xml"/>
- <replace file="${basedir}/dependencies.xml" token="<!--start-->" value="<!--"/>
- <replace file="${basedir}/dependencies.xml" token="<!--end-->" value="-->"/>
- <artifact:pom file="${basedir}/dependencies.xml" id="pom"/>
<artifact:dependencies pathId="pom.pathid" filesetId="pom.fileset" verbose="${verbose}">
<!--
<localRepository path="${bootstrap.repository}"/>
-->
<pom refid="pom"/>
</artifact:dependencies>
- <delete file="${basedir}/dependencies.xml"/>
<!-- Pull the dependencies for Modello -->
<artifact:dependencies pathId="modello.pathid" filesetId="modello.fileset" verbose="${verbose}">
@@ -244,4 +248,9 @@
<target name="with-its" depends="all,run-its"/>
+ <target name="set-temp-maven-home" depends="read-pom">
+ <property name="maven.home" value="${java.io.tmpdir}/apache-maven-${pom.version}"/>
+ <echo>Using temporary maven install directory: ${maven.home}</echo>
+ </target>
+
</project>