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/26 02:32:41 UTC

svn commit: r720697 - in /maven/components/branches/maven-2.0.10-RC: build.xml maven-integration-tests/pom.xml

Author: jdcasey
Date: Tue Nov 25 17:32:41 2008
New Revision: 720697

URL: http://svn.apache.org/viewvc?rev=720697&view=rev
Log:
Adding some measures to avoid specifying /tmp path directly, to allow the bootstrap and ITs to run on more operating systems (*cough* Solaris *cough*).

Modified:
    maven/components/branches/maven-2.0.10-RC/build.xml
    maven/components/branches/maven-2.0.10-RC/maven-integration-tests/pom.xml

Modified: maven/components/branches/maven-2.0.10-RC/build.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.10-RC/build.xml?rev=720697&r1=720696&r2=720697&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.10-RC/build.xml (original)
+++ maven/components/branches/maven-2.0.10-RC/build.xml Tue Nov 25 17:32:41 2008
@@ -21,10 +21,16 @@
   
   <property name="it.workdir.version" value="2.0.10-RC"/>
 
-  <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="initLocalRepo">
+    <property name="maven.repo.local" value="${user.home}/.m2/repository"/>
+    <echo>Using the local repository at: ${maven.repo.local}</echo>
   </target>
 
   <target name="isMavenHomeSet" depends="initTaskDefs">
@@ -35,6 +41,16 @@
     <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-poms" depends="initTaskDefs,initLocalRepo" unless="pom.version">
+    <copy file="pom.xml" tofile="dependencies.xml"/>
+    <replace file="${basedir}/dependencies.xml" token="&lt;!--start--&gt;" value="&lt;!--"/>
+    <replace file="${basedir}/dependencies.xml" token="&lt;!--end--&gt;" value="--&gt;"/>
+    <artifact:pom file="${basedir}/dependencies.xml" id="pom"/>
+    <delete file="${basedir}/dependencies.xml"/>
+    
+    <artifact:pom file="${basedir}/maven-integration-tests/pom.xml" id="itPom"/>
+  </target>
+
   <target name="init" depends="isMavenHomeSet">
     <xmlproperty prefix="pom" file="pom.xml"/>    
     <basename file="${maven.home}" property="maven.home.basename"/>
@@ -46,21 +62,16 @@
     <delete dir="bootstrap"/>
   </target>
 
-  <target name="pull" depends="init" unless="skip.pull">    
+  <target name="pull" depends="init, read-poms" 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="&lt;!--start--&gt;" value="&lt;!--"/>
-    <replace file="${basedir}/dependencies.xml" token="&lt;!--end--&gt;" value="--&gt;"/>
-    <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}">
@@ -203,7 +214,12 @@
     <exec dir="${basedir}/maven-integration-tests" executable="cmd">
       <arg value="/c"/>
       <arg value="${maven.home}\bin\mvn.bat"/>
-      <arg value="initialize"/>
+      <arg value="process-resources"/>
+    </exec>
+    <exec dir="${basedir}/maven-integration-tests/target/classes" executable="cmd">
+      <arg value="/c"/>
+      <arg value="${maven.home}\bin\mvn.bat"/>
+      <arg value="package"/>
     </exec>
     
     <echo>Running integration tests</echo>
@@ -220,12 +236,15 @@
   <target name="its-unix" if="its.unix">
     <echo>Retrieving integration tests</echo>
     <exec dir="${basedir}/maven-integration-tests" executable="${maven.home}/bin/mvn">
-      <arg value="initialize"/>
+      <arg value="process-resources"/>
+    </exec>
+    <exec dir="${basedir}/maven-integration-tests/target/classes" executable="${maven.home}/bin/mvn">
+      <arg value="package"/>
     </exec>
     
     <echo>Running integration tests</echo>
     <!-- Hard-coding to /tmp/ to avoid long path names that will make windows scream. -->
-    <exec failonerror="true" dir="/tmp/maven-integration-tests-${it.workdir.version}" executable="${maven.home}/bin/mvn">
+    <exec failonerror="true" dir="/tmp/${itPom.artifactId}-${itPom.version}" executable="${maven.home}/bin/mvn">
       <arg value="-Prun-its"/>
       <arg value="clean"/>
       <arg value="install"/>
@@ -240,4 +259,9 @@
 
   <target name="with-its" depends="all,run-its"/>
   
+  <target name="set-temp-maven-home" depends="read-poms">
+    <property name="maven.home" value="${java.io.tmpdir}/apache-maven-${pom.version}"/>
+    <echo>Using temporary maven install directory: ${maven.home}</echo>
+  </target>
+  
 </project>

Modified: maven/components/branches/maven-2.0.10-RC/maven-integration-tests/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.10-RC/maven-integration-tests/pom.xml?rev=720697&r1=720696&r2=720697&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.10-RC/maven-integration-tests/pom.xml (original)
+++ maven/components/branches/maven-2.0.10-RC/maven-integration-tests/pom.xml Tue Nov 25 17:32:41 2008
@@ -11,7 +11,7 @@
   
   <properties>
     <integrationTestSVNDir>trunk</integrationTestSVNDir>
-    <itDir>${pom.basedir}/tests</itDir>
+    <itDir>${java.io.tmpdir}/${pom.artifactId}-${pom.version}</itDir>
   </properties>
   
   <profiles>
@@ -20,8 +20,7 @@
       <activation>
         <activeByDefault>true</activeByDefault>
         <file>
-          <!-- NOT INTERPOLATED. These values must be explicit. -->
-          <exists>/tmp/maven-integration-tests-2.0.10-RC/pom.xml</exists>
+          <exists>${itDir}/pom.xml</exists>
         </file>
       </activation>
       <build>
@@ -31,7 +30,7 @@
             <executions>
               <execution>
                 <id>scm</id>
-                <phase>initialize</phase>
+                <phase>package</phase>
                 <goals>
                   <goal>update</goal>
                 </goals>
@@ -45,8 +44,7 @@
       <id>checkout</id>
       <activation>
         <file>
-          <!-- NOT INTERPOLATED. These values must be explicit. -->
-          <missing>/tmp/maven-integration-tests-2.0.10-RC/pom.xml</missing>
+          <missing>${itDir}/pom.xml</missing>
         </file>
       </activation>
       <build>
@@ -56,7 +54,7 @@
             <executions>
               <execution>
                 <id>scm</id>
-                <phase>initialize</phase>
+                <phase>package</phase>
                 <goals>
                   <goal>checkout</goal>
                 </goals>
@@ -69,6 +67,15 @@
   </profiles>
   
   <build>
+    <resources>
+      <resource>
+        <directory>${basedir}</directory>
+        <includes>
+          <include>pom.xml</include>
+        </includes>
+        <filtering>true</filtering>
+      </resource>
+    </resources>
     <plugins>
       <plugin>
         <artifactId>maven-scm-plugin</artifactId>
@@ -77,7 +84,7 @@
           <connectionUrl>scm:svn:http://svn.apache.org/repos/asf/maven/core-integration-testing/${integrationTestSVNDir}</connectionUrl>
           <!-- Hard-coding to /tmp/ to avoid long path names that will make windows scream. -->
           <!-- NOT INTERPOLATED DURING PROFILE ACTIVATION, so making these values explicit throughout to avoid confusion. -->
-          <checkoutDirectory>/tmp/maven-integration-tests-2.0.10-RC</checkoutDirectory>
+          <checkoutDirectory>${itDir}</checkoutDirectory>
         </configuration>
       </plugin>
     </plugins>