diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0047Test.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0047Test.java index d571163c51..483d423420 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0047Test.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0047Test.java @@ -21,8 +21,11 @@ package org.apache.maven.it; import org.apache.maven.it.Verifier; import org.apache.maven.it.util.ResourceExtractor; +import org.apache.maven.it.util.StringUtils; import java.io.File; +import java.util.List; +import java.util.Properties; public class MavenIT0047Test extends AbstractMavenIntegrationTestCase @@ -37,11 +40,18 @@ public class MavenIT0047Test { File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0047" ); Verifier verifier = new Verifier( testDir.getAbsolutePath() ); - verifier.executeGoal( "compile" ); - verifier.assertFilePresent( "target/classes/org/apache/maven/it0047/Person.class" ); + Properties systemProperties = new Properties(); + systemProperties.put( "depres.compileClassPath", new File( testDir, "target/compile.txt" ).getAbsolutePath() ); + verifier.setSystemProperties( systemProperties ); + verifier.executeGoal( "org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution::compile" ); + verifier.assertFilePresent( "target/compile.txt" ); verifier.verifyErrorFreeLog(); verifier.resetStreams(); + List lines = verifier.loadLines( "target/compile.txt", "UTF-8" ); + String paths = StringUtils.join( lines.iterator(), "\t" ).replace( '\\', '/' ); + assertTrue( paths.indexOf( "org/apache/maven/its/it0047/direct-dep/1.0/direct-dep-1.0.jar" ) >= 0 ); + assertTrue( paths.indexOf( "org/apache/maven/its/it0047/transitive-dep/1.1/transitive-dep-1.1.jar" ) >= 0 ); } -} +} diff --git a/its/core-it-suite/src/test/resources/it0047/pom.xml b/its/core-it-suite/src/test/resources/it0047/pom.xml index 3a4454261d..15fe36d5db 100644 --- a/its/core-it-suite/src/test/resources/it0047/pom.xml +++ b/its/core-it-suite/src/test/resources/it0047/pom.xml @@ -1,16 +1,56 @@ + + + + 4.0.0 - Maven Integration Test :: it0047 + org.apache.maven.its.it0047 maven-it-it0047 - Test the use case for having a compile time dependency be transitive: - when you extend a class you need its dependencies at compile time. 1.0 + + Maven Integration Test :: it0047 + + Test the use case for having a compile time dependency be transitive: + when you extend a class you need its dependencies at compile time. + + + - org.codehaus.plexus - plexus-container-default - 1.0-alpha-7 + org.apache.maven.its.it0047 + direct-dep + 1.0 + + + + maven-core-it + file:///${basedir}/repo + + ignore + + + ignore + + + diff --git a/its/core-it-suite/src/test/resources/it0047/repo/org/apache/maven/its/it0047/direct-dep/1.0/direct-dep-1.0.jar b/its/core-it-suite/src/test/resources/it0047/repo/org/apache/maven/its/it0047/direct-dep/1.0/direct-dep-1.0.jar new file mode 100644 index 0000000000..486b10b560 Binary files /dev/null and b/its/core-it-suite/src/test/resources/it0047/repo/org/apache/maven/its/it0047/direct-dep/1.0/direct-dep-1.0.jar differ diff --git a/its/core-it-suite/src/test/resources/it0047/repo/org/apache/maven/its/it0047/direct-dep/1.0/direct-dep-1.0.pom b/its/core-it-suite/src/test/resources/it0047/repo/org/apache/maven/its/it0047/direct-dep/1.0/direct-dep-1.0.pom new file mode 100644 index 0000000000..bf43590d25 --- /dev/null +++ b/its/core-it-suite/src/test/resources/it0047/repo/org/apache/maven/its/it0047/direct-dep/1.0/direct-dep-1.0.pom @@ -0,0 +1,46 @@ + + + + + + 4.0.0 + + org.apache.maven.its.it0047 + direct-dep + 1.0 + jar + + + + maven-core-it + file:///${basedir}/repo + + + + + + + org.apache.maven.its.it0047 + transitive-dep + 1.1 + compile + + + diff --git a/its/core-it-suite/src/test/resources/it0047/repo/org/apache/maven/its/it0047/direct-dep/maven-metadata.xml b/its/core-it-suite/src/test/resources/it0047/repo/org/apache/maven/its/it0047/direct-dep/maven-metadata.xml new file mode 100644 index 0000000000..0d22411fd8 --- /dev/null +++ b/its/core-it-suite/src/test/resources/it0047/repo/org/apache/maven/its/it0047/direct-dep/maven-metadata.xml @@ -0,0 +1,11 @@ + + org.apache.maven.its.it0047 + direct-dep + 1.0 + + + 1.0 + + 20081001201944 + + \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/it0047/repo/org/apache/maven/its/it0047/transitive-dep/1.1/transitive-dep-1.1.jar b/its/core-it-suite/src/test/resources/it0047/repo/org/apache/maven/its/it0047/transitive-dep/1.1/transitive-dep-1.1.jar new file mode 100644 index 0000000000..4bac491843 Binary files /dev/null and b/its/core-it-suite/src/test/resources/it0047/repo/org/apache/maven/its/it0047/transitive-dep/1.1/transitive-dep-1.1.jar differ diff --git a/its/core-it-suite/src/test/resources/it0047/repo/org/apache/maven/its/it0047/transitive-dep/1.1/transitive-dep-1.1.pom b/its/core-it-suite/src/test/resources/it0047/repo/org/apache/maven/its/it0047/transitive-dep/1.1/transitive-dep-1.1.pom new file mode 100644 index 0000000000..24d00acb91 --- /dev/null +++ b/its/core-it-suite/src/test/resources/it0047/repo/org/apache/maven/its/it0047/transitive-dep/1.1/transitive-dep-1.1.pom @@ -0,0 +1,36 @@ + + + + + + 4.0.0 + + org.apache.maven.its.it0047 + transitive-dep + 1.1 + jar + + + + maven-core-it + file:///${basedir}/repo + + + diff --git a/its/core-it-suite/src/test/resources/it0047/repo/org/apache/maven/its/it0047/transitive-dep/maven-metadata.xml b/its/core-it-suite/src/test/resources/it0047/repo/org/apache/maven/its/it0047/transitive-dep/maven-metadata.xml new file mode 100644 index 0000000000..a13c2af771 --- /dev/null +++ b/its/core-it-suite/src/test/resources/it0047/repo/org/apache/maven/its/it0047/transitive-dep/maven-metadata.xml @@ -0,0 +1,11 @@ + + org.apache.maven.its.it0047 + transitive-dep + 1.1 + + + 1.1 + + 20081001201930 + + \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/it0047/src/main/java/org/apache/maven/it0047/Person.java b/its/core-it-suite/src/test/resources/it0047/src/main/java/org/apache/maven/it0047/Person.java deleted file mode 100644 index ce8320bf4d..0000000000 --- a/its/core-it-suite/src/test/resources/it0047/src/main/java/org/apache/maven/it0047/Person.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.apache.maven.it0047; - -import org.codehaus.plexus.PlexusTestCase; - -public class Person - extends PlexusTestCase -{ - private String name; - - public void setName( String name ) - { - this.name = name; - } - - public String getName() - { - return name; - } -}