You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2010/01/24 01:20:03 UTC

svn commit: r902514 - in /maven/core-integration-testing/trunk/core-it-suite/src/test: java/org/apache/maven/it/ resources/mng-4522/ resources/mng-4522/repo/ resources/mng-4522/repo/org/ resources/mng-4522/repo/org/apache/ resources/mng-4522/repo/org/a...

Author: bentmann
Date: Sun Jan 24 00:20:02 2010
New Revision: 902514

URL: http://svn.apache.org/viewvc?rev=902514&view=rev
Log:
[MNG-4522] Maven3 doesn't fail build when a pom from transitive dependency can't be found

o Added IT

Added:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4522FailUponMissingDependencyParentPomTest.java   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/repo/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/repo/org/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/repo/org/apache/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/repo/org/apache/maven/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/repo/org/apache/maven/its/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/repo/org/apache/maven/its/mng4522/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/repo/org/apache/maven/its/mng4522/dep/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/repo/org/apache/maven/its/mng4522/dep/0.1-SNAPSHOT/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/repo/org/apache/maven/its/mng4522/dep/0.1-SNAPSHOT/dep-0.1-20100123.231127-1.jar   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/repo/org/apache/maven/its/mng4522/dep/0.1-SNAPSHOT/dep-0.1-20100123.231127-1.pom
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/repo/org/apache/maven/its/mng4522/dep/0.1-SNAPSHOT/maven-metadata.xml   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/settings-template.xml   (with props)
Modified:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java

Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java?rev=902514&r1=902513&r2=902514&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java (original)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java Sun Jan 24 00:20:02 2010
@@ -86,6 +86,7 @@
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
 
         suite.addTestSuite( MavenITmng4544ActiveComponentCollectionThreadSafeTest.class );
+        suite.addTestSuite( MavenITmng4522FailUponMissingDependencyParentPomTest.class );
         suite.addTestSuite( MavenITmng4500NoUpdateOfTimestampedSnapshotsTest.class );
         suite.addTestSuite( MavenITmng4498IgnoreBrokenMetadataTest.class );
         suite.addTestSuite( MavenITmng4489MirroringOfExtensionRepoTest.class );

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4522FailUponMissingDependencyParentPomTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4522FailUponMissingDependencyParentPomTest.java?rev=902514&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4522FailUponMissingDependencyParentPomTest.java (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4522FailUponMissingDependencyParentPomTest.java Sun Jan 24 00:20:02 2010
@@ -0,0 +1,72 @@
+package org.apache.maven.it;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.it.Verifier;
+import org.apache.maven.it.util.ResourceExtractor;
+
+import java.io.File;
+
+/**
+ * This is a test set for <a href="http://jira.codehaus.org/browse/MNG-4522">MNG-4522</a>.
+ * 
+ * @author Benjamin Bentmann
+ */
+public class MavenITmng4522FailUponMissingDependencyParentPomTest
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng4522FailUponMissingDependencyParentPomTest()
+    {
+        super( "[2.0.3,3.0-alpha-1),[3.0-alpha-7,)" );
+    }
+
+    /**
+     * Test that unreadable metadata from one repository does not fail the entire dependency resolution.
+     */
+    public void testit()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4522" );
+
+        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.deleteDirectory( "target" );
+        verifier.deleteArtifacts( "org.apache.maven.its.mng4522" );
+        verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() );
+        verifier.getCliOptions().add( "--settings" );
+        verifier.getCliOptions().add( "settings.xml" );
+        try
+        {
+            verifier.executeGoal( "validate" );
+            verifier.verifyErrorFreeLog();
+            fail( "Missing parent POM of dependency did not fail the build." );
+        }
+        catch ( VerificationException e )
+        {
+            // expected
+        }
+        finally
+        {
+            verifier.resetStreams();
+        }
+    }
+
+}

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4522FailUponMissingDependencyParentPomTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4522FailUponMissingDependencyParentPomTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/pom.xml?rev=902514&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/pom.xml Sun Jan 24 00:20:02 2010
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.mng4522</groupId>
+  <artifactId>test</artifactId>
+  <version>0.1</version>
+
+  <name>Maven Integration Test :: MNG-4522</name>
+  <description>
+    Test that dependency resolution fails/aborts in case a dependency has a POM that inherits from a missing parent.
+  </description>
+
+  <dependencies>
+    <dependency>
+      <!-- The parent POM of its POM is missing and should fail the build -->
+      <groupId>org.apache.maven.its.mng4522</groupId>
+      <artifactId>dep</artifactId>
+      <version>0.1-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-dependency-resolution</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <configuration>
+          <compileClassPath>target/classpath.txt</compileClassPath>
+          <significantPathLevels>1</significantPathLevels>
+        </configuration>
+        <executions>
+          <execution>
+            <id>test</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>compile</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/repo/org/apache/maven/its/mng4522/dep/0.1-SNAPSHOT/dep-0.1-20100123.231127-1.jar
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/repo/org/apache/maven/its/mng4522/dep/0.1-SNAPSHOT/dep-0.1-20100123.231127-1.jar?rev=902514&view=auto
==============================================================================
Binary file - no diff available.

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/repo/org/apache/maven/its/mng4522/dep/0.1-SNAPSHOT/dep-0.1-20100123.231127-1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/repo/org/apache/maven/its/mng4522/dep/0.1-SNAPSHOT/dep-0.1-20100123.231127-1.pom
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/repo/org/apache/maven/its/mng4522/dep/0.1-SNAPSHOT/dep-0.1-20100123.231127-1.pom?rev=902514&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/repo/org/apache/maven/its/mng4522/dep/0.1-SNAPSHOT/dep-0.1-20100123.231127-1.pom (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/repo/org/apache/maven/its/mng4522/dep/0.1-SNAPSHOT/dep-0.1-20100123.231127-1.pom Sun Jan 24 00:20:02 2010
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <!-- NOTE: This parent is deliberately missing -->
+    <groupId>org.apache.maven.its.mng4522</groupId>
+    <artifactId>parent</artifactId>
+    <version>0.1-SNAPSHOT</version>
+  </parent>
+
+  <groupId>org.apache.maven.its.mng4522</groupId>
+  <artifactId>dep</artifactId>
+  <version>0.1-SNAPSHOT</version>
+  <packaging>jar</packaging>
+
+  <name>Maven Integration Test :: MNG-4522 :: Dependency</name>
+
+  <distributionManagement>
+    <repository>
+      <id>maven-core-it</id>
+      <url>file:///${basedir}/repo</url>
+    </repository>
+  </distributionManagement>
+</project>

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/repo/org/apache/maven/its/mng4522/dep/0.1-SNAPSHOT/maven-metadata.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/repo/org/apache/maven/its/mng4522/dep/0.1-SNAPSHOT/maven-metadata.xml?rev=902514&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/repo/org/apache/maven/its/mng4522/dep/0.1-SNAPSHOT/maven-metadata.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/repo/org/apache/maven/its/mng4522/dep/0.1-SNAPSHOT/maven-metadata.xml Sun Jan 24 00:20:02 2010
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata>
+  <groupId>org.apache.maven.its.mng4522</groupId>
+  <artifactId>dep</artifactId>
+  <version>0.1-SNAPSHOT</version>
+  <versioning>
+    <snapshot>
+      <timestamp>20100123.231127</timestamp>
+      <buildNumber>1</buildNumber>
+    </snapshot>
+    <lastUpdated>20100123231127</lastUpdated>
+  </versioning>
+</metadata>

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/repo/org/apache/maven/its/mng4522/dep/0.1-SNAPSHOT/maven-metadata.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/repo/org/apache/maven/its/mng4522/dep/0.1-SNAPSHOT/maven-metadata.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/settings-template.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/settings-template.xml?rev=902514&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/settings-template.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/settings-template.xml Sun Jan 24 00:20:02 2010
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<settings>
+  <profiles>
+    <profile>
+      <id>maven-core-it-repo</id>
+      <repositories>
+        <repository>
+          <id>maven-core-it</id>
+          <url>@baseurl@/repo</url>
+          <releases>
+            <enabled>false</enabled>
+          </releases>
+          <snapshots>
+            <checksumPolicy>ignore</checksumPolicy>
+          </snapshots>
+        </repository>
+      </repositories>
+    </profile>
+  </profiles>
+  <activeProfiles>
+    <activeProfile>maven-core-it-repo</activeProfile>
+  </activeProfiles>
+</settings>

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/settings-template.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4522/settings-template.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision