You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ke...@apache.org on 2007/01/19 14:27:45 UTC

svn commit: r497808 - in /maven/core-integration-testing/trunk/core-integration-tests/src/test: java/org/apache/maven/integrationtests/ resources/it0043/ resources/it0043/child1/ resources/it0043/child2/ resources/it0043/child2/src/ resources/it0043/src/

Author: kenney
Date: Fri Jan 19 05:27:44 2007
New Revision: 497808

URL: http://svn.apache.org/viewvc?view=rev&rev=497808
Log:
Fix IT0043.

With a clean repo, the help plugin is not available.
Since the central repo was overridden to /tmp/emptyRepo,
it can not be retrieved.

Solved this by moving the project to child2, which has
a dep on child1, and adding a parent pom.
Child1 makes sure the help plugin is available because it doesn't
override central.

Also, because of MPH-21, I had to use the 2.0.2 snapshot version.
Previously there was only 1 project in the reactor, so the effective pom
only contained one project. 2.0.1 will write ALL poms in 1 file,
and the it test fails since 'repo1.maven.org' is in that file, though
not in the child2 project.

Further, I found a new/old bug, where if you DON'T specify the 2.0.2-snap
in child2, maven-artifact tries to resolve the help plugin from the central
repo, which fails because it's empty (/tmp/emptyRepo). 
It then does NOT use the available metadata in the local repo to get the
proper plugin version, but simply fails with the message that no valid
version for the help plugin could be found.
Even specifying the snapshot plugin repo in child2 doesn't matter - it is not
searched.


Added:
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0043/child1/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0043/child1/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0043/child2/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0043/child2/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0043/child2/src/
      - copied from r497425, maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0043/src/
Removed:
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0043/src/
Modified:
    maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0043Test.java
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0043/pom.xml

Modified: maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0043Test.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0043Test.java?view=diff&rev=497808&r1=497807&r2=497808
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0043Test.java (original)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenIT0043Test.java Fri Jan 19 05:27:44 2007
@@ -18,7 +18,8 @@
         File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0043" );
         Verifier verifier = new Verifier( testDir.getAbsolutePath() );
         verifier.executeGoal( "package" );
-        verifier.assertFilePresent( "target/maven-it-it0043-1.0-SNAPSHOT.jar" );
+        verifier.assertFilePresent( "child1/target/maven-it-it0043-child1-1.0-SNAPSHOT.jar" );
+        verifier.assertFilePresent( "child2/target/maven-it-it0043-child2-1.0-SNAPSHOT.jar" );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
 

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0043/child1/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0043/child1/pom.xml?view=auto&rev=497808
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0043/child1/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0043/child1/pom.xml Fri Jan 19 05:27:44 2007
@@ -0,0 +1,43 @@
+<project>
+  <modelVersion>4.0.0</modelVersion>
+	<groupId>org.apache.maven.its.it0043</groupId>
+  <artifactId>maven-it-it0043-child1</artifactId>
+	<version>1.0-SNAPSHOT</version>
+  <name>Maven Integration Test :: it0043 Child1</name> 
+  <description>Test for repository inheritence - ensure using the same id overrides the defaults</description>
+
+	<!-- Use 2.0.2-SNAPSHOT because of MPH-21. Remove when it's released. -->
+  <pluginRepositories>
+    <pluginRepository>
+      <id>apache.snapshots</id>
+      <name>Apache Snapshot Repository</name>
+      <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+      <releases>
+        <enabled>false</enabled>
+      </releases>
+    </pluginRepository>
+  </pluginRepositories>
+
+	<!-- ensure help plugin is in the local repo, as child2 overrides
+	     the central repo, but tries to run the help plugin -->
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-help-plugin</artifactId>
+				<!-- use 2.0.2-snap until it's released, due to bug described above -->
+				<version>2.0.2-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <phase>generate-resources</phase>
+            <goals>
+              <goal>effective-pom</goal>
+            </goals>
+            <configuration>
+              <output>${project.build.directory}/effective-pom-child1.xml</output>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0043/child1/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0043/child1/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0043/child2/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0043/child2/pom.xml?view=auto&rev=497808
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0043/child2/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0043/child2/pom.xml Fri Jan 19 05:27:44 2007
@@ -0,0 +1,60 @@
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.its.it0043</groupId>
+  <artifactId>maven-it-it0043-child2</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <name>Maven Integration Test :: it0043 Child2</name> 
+  <description>Test for repository inheritence - ensure using the same id overrides the defaults</description>
+
+  <repositories>
+    <repository>
+      <id>central</id>
+      <name>Empty Repository</name>
+      <url>file:/tmp/emptyRepo</url>
+    </repository>
+  </repositories>
+
+  <pluginRepositories>
+    <pluginRepository>
+      <id>central</id>
+      <name>Empty Repository</name>
+      <url>file:/tmp/emptyRepo</url>
+    </pluginRepository>
+  </pluginRepositories>
+
+  <dependencies>
+    <!-- make sure child1 is built first so the help plugin is in
+         the local repo -->
+    <dependency>
+      <groupId>org.apache.maven.its.it0043</groupId>
+      <artifactId>maven-it-it0043-child1</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+
+    <dependency>
+      <artifactId>junit</artifactId>
+      <groupId>junit</groupId>
+      <version>3.8.1</version>
+    </dependency>
+  </dependencies>
+  
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-help-plugin</artifactId>
+				<version>2.0.2-SNAPSHOT</version> <!-- Removing this will cause MNG-900 -->
+        <executions>
+          <execution>
+            <phase>generate-test-resources</phase>
+            <goals>
+              <goal>effective-pom</goal>
+            </goals>
+            <configuration>
+              <output>${project.build.directory}/effective-pom.xml</output>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0043/child2/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0043/child2/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0043/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0043/pom.xml?view=diff&rev=497808&r1=497807&r2=497808
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0043/pom.xml (original)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/it0043/pom.xml Fri Jan 19 05:27:44 2007
@@ -1,52 +1,21 @@
 <project>
   <modelVersion>4.0.0</modelVersion>
-  <name>Maven Integration Test :: it0043</name> 
+  <name>Maven Integration Test :: it0043 Parent</name> 
   <groupId>org.apache.maven.its.it0043</groupId>
-  <artifactId>maven-it-it0043</artifactId>
+  <artifactId>maven-it-it0043-parent</artifactId>
   <description>Test for repository inheritence - ensure using the same id overrides the defaults</description>
   <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
 
-  <repositories>
-    <repository>
-      <id>central</id>
-      <name>Empty Repository</name>
-      <url>file:/tmp/emptyRepo</url>
-    </repository>
-  </repositories>
+	<!-- this 3 project structure is to make sure that the help:plugin,
+	     used in child2, where the real test is, is available in the
+			 local repo. Child2 depends on child1 which uses the help plugin
+			 in a dummy call to make sure it's available. Then child2 is
+			 built, overriding the central repo. -->
 
-  <pluginRepositories>
-    <pluginRepository>
-      <id>central</id>
-      <name>Empty Repository</name>
-      <url>file:/tmp/emptyRepo</url>
-    </pluginRepository>
-  </pluginRepositories>
+  <modules>
+    <module>child1</module>
+    <module>child2</module>
+  </modules>
 
-
-  <dependencies>
-    <dependency>
-      <artifactId>junit</artifactId>
-      <groupId>junit</groupId>
-      <version>3.8.1</version>
-    </dependency>
-  </dependencies>
-  
-  <build>
-    <plugins>
-      <plugin>
-        <artifactId>maven-help-plugin</artifactId>
-        <executions>
-          <execution>
-            <phase>generate-test-resources</phase>
-            <goals>
-              <goal>effective-pom</goal>
-            </goals>
-            <configuration>
-              <output>${project.build.directory}/effective-pom.xml</output>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
 </project>