diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3680InvalidDependencyPOMTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3680InvalidDependencyPOMTest.java index ee11849425..65cd1e638e 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3680InvalidDependencyPOMTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3680InvalidDependencyPOMTest.java @@ -20,46 +20,44 @@ package org.apache.maven.it; */ import java.io.File; +import java.util.List; import org.apache.maven.it.Verifier; import org.apache.maven.it.util.ResourceExtractor; /** - * Verify that dependencies with invalid POMs can still be used without failing - * the build. + * This is a test set for MNG-3680. * * @author jdcasey */ public class MavenITmng3680InvalidDependencyPOMTest extends AbstractMavenIntegrationTestCase { + public MavenITmng3680InvalidDependencyPOMTest() { super( "(2.0.9,)" ); } - + + /** + * Verify that dependencies with invalid POMs can still be used without failing the build. + */ public void testitMNG3680 () throws Exception { File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3680" ); - File pluginDir = new File( testDir, "maven-mng3680-plugin" ); - Verifier verifier = new Verifier( pluginDir.getAbsolutePath() ); - - verifier.executeGoal( "install" ); - verifier.verifyErrorFreeLog(); - verifier.resetStreams(); - - verifier = new Verifier( testDir.getAbsolutePath() ); - - verifier.deleteArtifact( "tests", "dep-L1", "1", "jar" ); - verifier.deleteArtifact( "tests", "dep-L1", "1", "pom" ); - - verifier.deleteArtifact( "tests", "dep-L1", "1", "jar" ); - verifier.deleteArtifact( "tests", "dep-L2", "1", "pom" ); - + Verifier verifier = new Verifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); + verifier.deleteArtifacts( "org.apache.maven.its.mng3680" ); verifier.executeGoal( "validate" ); verifier.verifyErrorFreeLog(); verifier.resetStreams(); + + List artifacts = verifier.loadLines( "target/artifacts.txt", "UTF-8" ); + assertTrue( artifacts.toString(), artifacts.contains( "org.apache.maven.its.mng3680:direct:jar:0.1" ) ); + assertTrue( artifacts.toString(), artifacts.contains( "org.apache.maven.its.mng3680:transitive:jar:0.1" ) ); } + } diff --git a/its/core-it-suite/src/test/resources/mng-3680/dep-repo/dep-L2/pom.xml b/its/core-it-suite/src/test/resources/mng-3680/dep-repo/dep-L2/pom.xml deleted file mode 100644 index 7146f2bd9a..0000000000 --- a/its/core-it-suite/src/test/resources/mng-3680/dep-repo/dep-L2/pom.xml +++ /dev/null @@ -1,16 +0,0 @@ - - 4.0.0 - tests - dep-L2 - jar - 1 - dep-L2 - - - - dep-repo - file://${pom.basedir}/.. - - - diff --git a/its/core-it-suite/src/test/resources/mng-3680/dep-repo/dep-L2/src/main/java/tests/level2/AppLevel2.java b/its/core-it-suite/src/test/resources/mng-3680/dep-repo/dep-L2/src/main/java/tests/level2/AppLevel2.java deleted file mode 100644 index 2421dbbeb5..0000000000 --- a/its/core-it-suite/src/test/resources/mng-3680/dep-repo/dep-L2/src/main/java/tests/level2/AppLevel2.java +++ /dev/null @@ -1,13 +0,0 @@ -package tests.level2; - -/** - * Hello world! - * - */ -public class AppLevel2 -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); - } -} diff --git a/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L1/1/dep-L1-1.jar b/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L1/1/dep-L1-1.jar deleted file mode 100644 index a3343096e6..0000000000 Binary files a/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L1/1/dep-L1-1.jar and /dev/null differ diff --git a/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L1/1/dep-L1-1.pom b/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L1/1/dep-L1-1.pom deleted file mode 100644 index e2562e5d84..0000000000 --- a/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L1/1/dep-L1-1.pom +++ /dev/null @@ -1,28 +0,0 @@ - - 4.0.0 - tests - dep-L1 - jar - 1 - - - - tests - dep-L2 - 1 - - - - - - imaginary-repo - http://repository.imaginary/ - - diff --git a/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L2/1/dep-L2-1.jar b/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L2/1/dep-L2-1.jar deleted file mode 100644 index cca6ad1b55..0000000000 Binary files a/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L2/1/dep-L2-1.jar and /dev/null differ diff --git a/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L2/1/dep-L2-1.jar.md5 b/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L2/1/dep-L2-1.jar.md5 deleted file mode 100644 index becc323fed..0000000000 --- a/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L2/1/dep-L2-1.jar.md5 +++ /dev/null @@ -1 +0,0 @@ -624ade12bfc6d4f4b651626cf9009700 \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L2/1/dep-L2-1.jar.sha1 b/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L2/1/dep-L2-1.jar.sha1 deleted file mode 100644 index 46fe0d1f7c..0000000000 --- a/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L2/1/dep-L2-1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -f4f142d0469c316b1ee67c05445415ec8ff38e4e \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L2/1/dep-L2-1.pom b/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L2/1/dep-L2-1.pom deleted file mode 100644 index 7146f2bd9a..0000000000 --- a/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L2/1/dep-L2-1.pom +++ /dev/null @@ -1,16 +0,0 @@ - - 4.0.0 - tests - dep-L2 - jar - 1 - dep-L2 - - - - dep-repo - file://${pom.basedir}/.. - - - diff --git a/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L2/1/dep-L2-1.pom.md5 b/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L2/1/dep-L2-1.pom.md5 deleted file mode 100644 index def3b32387..0000000000 --- a/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L2/1/dep-L2-1.pom.md5 +++ /dev/null @@ -1 +0,0 @@ -980a7b547686732abf321a5c17c95fb1 \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L2/1/dep-L2-1.pom.sha1 b/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L2/1/dep-L2-1.pom.sha1 deleted file mode 100644 index b30ae01873..0000000000 --- a/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L2/1/dep-L2-1.pom.sha1 +++ /dev/null @@ -1 +0,0 @@ -cce03f3942f7aadaee9ed0e8f4cf384fa4fed319 \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L2/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L2/maven-metadata.xml deleted file mode 100644 index a4f29b80a5..0000000000 --- a/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L2/maven-metadata.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - tests - dep-L2 - 1 - - - 1 - - 20080725163900 - - diff --git a/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L2/maven-metadata.xml.md5 b/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L2/maven-metadata.xml.md5 deleted file mode 100644 index 6aaf401f1a..0000000000 --- a/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L2/maven-metadata.xml.md5 +++ /dev/null @@ -1 +0,0 @@ -daa840dd62763fc61fdf6d78ef6c7da3 \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L2/maven-metadata.xml.sha1 b/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L2/maven-metadata.xml.sha1 deleted file mode 100644 index 2181c02299..0000000000 --- a/its/core-it-suite/src/test/resources/mng-3680/dep-repo/tests/dep-L2/maven-metadata.xml.sha1 +++ /dev/null @@ -1 +0,0 @@ -3f10e68aeceeb95476ec0b0ba3ed2be3ab245be9 \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/mng-3680/maven-mng3680-plugin/pom.xml b/its/core-it-suite/src/test/resources/mng-3680/maven-mng3680-plugin/pom.xml deleted file mode 100644 index cb0627594c..0000000000 --- a/its/core-it-suite/src/test/resources/mng-3680/maven-mng3680-plugin/pom.xml +++ /dev/null @@ -1,28 +0,0 @@ - - 4.0.0 - org.apache.maven.its.mng3680 - maven-mng3680-plugin - maven-plugin - 1 - maven-mng3680-plugin Maven Mojo - http://maven.apache.org - - - org.apache.maven - maven-plugin-api - 2.0 - - - junit - junit - 3.8.1 - test - - - org.apache.maven - maven-artifact - 2.0.9 - - - diff --git a/its/core-it-suite/src/test/resources/mng-3680/maven-mng3680-plugin/src/main/java/plugin/MyMojo.java b/its/core-it-suite/src/test/resources/mng-3680/maven-mng3680-plugin/src/main/java/plugin/MyMojo.java deleted file mode 100644 index e14d161386..0000000000 --- a/its/core-it-suite/src/test/resources/mng-3680/maven-mng3680-plugin/src/main/java/plugin/MyMojo.java +++ /dev/null @@ -1,79 +0,0 @@ -package plugin; - -/* - * Copyright 2001-2005 The Apache Software Foundation. - * - * Licensed 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.artifact.Artifact; -import org.apache.maven.plugin.AbstractMojo; -import org.apache.maven.plugin.MojoExecutionException; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.util.Iterator; -import java.util.List; - -/** - * Goal which touches a timestamp file. - * - * @goal check - * @requiresDependencyResolution compile - * @phase validate - */ -public class MyMojo - extends AbstractMojo -{ - /** - * @parameter expression="${project.compileArtifacts}" - * @required - */ - private List artifacts; - - public void execute() - throws MojoExecutionException - { - boolean foundL1 = false; - boolean foundL2 = false; - - if ( artifacts != null ) - { - for ( Iterator it = artifacts.iterator(); it.hasNext(); ) - { - Artifact artifact = (Artifact) it.next(); - - if ( !foundL1 && artifact.getArtifactId().equals( "dep-L1" ) ) - { - foundL1 = true; - } - else if ( !foundL2 && artifact.getArtifactId().equals( "dep-L2" ) ) - { - foundL2 = true; - } - - if ( foundL1 && foundL2 ) - { - break; - } - } - } - - if ( !foundL1 || !foundL2 ) - { - throw new MojoExecutionException( "Didn't find the following artifacts: " + ( foundL1 ? "" : "\n- dep-L1" ) - + ( foundL2 ? "" : "\n- dep-L2" ) ); - } - } -} diff --git a/its/core-it-suite/src/test/resources/mng-3680/pom.xml b/its/core-it-suite/src/test/resources/mng-3680/pom.xml index d55f64cbb8..3eeacc3262 100644 --- a/its/core-it-suite/src/test/resources/mng-3680/pom.xml +++ b/its/core-it-suite/src/test/resources/mng-3680/pom.xml @@ -1,45 +1,54 @@ 4.0.0 + org.apache.maven.its.mng3680 - mng-3680-invalidDependencyPOM + test jar 1 - mng-3680-invalidDependencyPOM + + Maven Integration Test :: MNG-3680 + + Verify that dependencies with invalid POMs can still be used without failing the build. + - dep-repo - file://${pom.basedir}/dep-repo + maven-core-it + file:///${basedir}/repo + + ignore + + + false + - junit - junit - 3.8.1 - test - - - tests - dep-L1 - 1 + + org.apache.maven.its.mng3680 + direct + 0.1 - org.apache.maven.its.mng3680 - maven-mng3680-plugin - 1 + org.apache.maven.its.plugins + maven-it-plugin-dependency-resolution + 2.1-SNAPSHOT - check-deps + test validate + + target/artifacts.txt + - check + test diff --git a/its/core-it-suite/src/test/resources/mng-3680/repo/org/apache/maven/its/mng3680/direct/0.1/direct-0.1.jar b/its/core-it-suite/src/test/resources/mng-3680/repo/org/apache/maven/its/mng3680/direct/0.1/direct-0.1.jar new file mode 100644 index 0000000000..60ea32386c Binary files /dev/null and b/its/core-it-suite/src/test/resources/mng-3680/repo/org/apache/maven/its/mng3680/direct/0.1/direct-0.1.jar differ diff --git a/its/core-it-suite/src/test/resources/mng-3680/repo/org/apache/maven/its/mng3680/direct/0.1/direct-0.1.pom b/its/core-it-suite/src/test/resources/mng-3680/repo/org/apache/maven/its/mng3680/direct/0.1/direct-0.1.pom new file mode 100644 index 0000000000..1f5dd2ef6f --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-3680/repo/org/apache/maven/its/mng3680/direct/0.1/direct-0.1.pom @@ -0,0 +1,57 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng3680 + direct + 0.1 + jar + + + + org.apache.maven.its.mng3680 + transitive + 0.1 + + + + + + imaginary-repo + http://repository.imaginary/ + + + + + maven-core-it + file:///${basedir}/repo + + + diff --git a/its/core-it-suite/src/test/resources/mng-3680/repo/org/apache/maven/its/mng3680/direct/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-3680/repo/org/apache/maven/its/mng3680/direct/maven-metadata.xml new file mode 100644 index 0000000000..52120561c2 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-3680/repo/org/apache/maven/its/mng3680/direct/maven-metadata.xml @@ -0,0 +1,11 @@ + + org.apache.maven.its.mng3680 + direct + 0.1 + + + 0.1 + + 20090113200208 + + \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/mng-3680/repo/org/apache/maven/its/mng3680/transitive/0.1/transitive-0.1.jar b/its/core-it-suite/src/test/resources/mng-3680/repo/org/apache/maven/its/mng3680/transitive/0.1/transitive-0.1.jar new file mode 100644 index 0000000000..34ee2c13e7 Binary files /dev/null and b/its/core-it-suite/src/test/resources/mng-3680/repo/org/apache/maven/its/mng3680/transitive/0.1/transitive-0.1.jar differ diff --git a/its/core-it-suite/src/test/resources/mng-3680/repo/org/apache/maven/its/mng3680/transitive/0.1/transitive-0.1.pom b/its/core-it-suite/src/test/resources/mng-3680/repo/org/apache/maven/its/mng3680/transitive/0.1/transitive-0.1.pom new file mode 100644 index 0000000000..132b4c07c4 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-3680/repo/org/apache/maven/its/mng3680/transitive/0.1/transitive-0.1.pom @@ -0,0 +1,36 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng3680 + transitive + 0.1 + jar + + + + maven-core-it + file:///${basedir}/repo + + + diff --git a/its/core-it-suite/src/test/resources/mng-3680/repo/org/apache/maven/its/mng3680/transitive/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-3680/repo/org/apache/maven/its/mng3680/transitive/maven-metadata.xml new file mode 100644 index 0000000000..e405363601 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-3680/repo/org/apache/maven/its/mng3680/transitive/maven-metadata.xml @@ -0,0 +1,11 @@ + + org.apache.maven.its.mng3680 + transitive + 0.1 + + + 0.1 + + 20090113200129 + + \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/mng-3680/src/main/java/tests/App.java b/its/core-it-suite/src/test/resources/mng-3680/src/main/java/tests/App.java deleted file mode 100644 index 13d4172110..0000000000 --- a/its/core-it-suite/src/test/resources/mng-3680/src/main/java/tests/App.java +++ /dev/null @@ -1,15 +0,0 @@ -package tests; - -import tests.level2.AppLevel2; - -/** - * Hello world! - * - */ -public class App -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); - } -} diff --git a/its/core-it-suite/src/test/resources/mng-3680/src/test/java/tests/AppTest.java b/its/core-it-suite/src/test/resources/mng-3680/src/test/java/tests/AppTest.java deleted file mode 100644 index c378ad2cd5..0000000000 --- a/its/core-it-suite/src/test/resources/mng-3680/src/test/java/tests/AppTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package tests; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * Unit test for simple App. - */ -public class AppTest - extends TestCase -{ - /** - * Create the test case - * - * @param testName name of the test case - */ - public AppTest( String testName ) - { - super( testName ); - } - - /** - * @return the suite of tests being tested - */ - public static Test suite() - { - return new TestSuite( AppTest.class ); - } - - /** - * Rigourous Test :-) - */ - public void testApp() - { - assertTrue( true ); - } -}