From b1880e667159515a379958477b93a11f38f69851 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Fri, 26 Mar 2010 20:59:43 +0000 Subject: [PATCH] [MNG-2222] dependency to dependency without source code fails o Added IT git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@928057 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/it/IntegrationTestSuite.java | 1 + ...2OutputDirectoryReactorResolutionTest.java | 65 +++++++++++++++++ .../src/test/resources/mng-2222/mod-a/pom.xml | 40 +++++++++++ .../src/test/resources/mng-2222/mod-b/pom.xml | 71 +++++++++++++++++++ .../src/test/resources/mng-2222/pom.xml | 58 +++++++++++++++ 5 files changed, 235 insertions(+) create mode 100644 its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2222OutputDirectoryReactorResolutionTest.java create mode 100644 its/core-it-suite/src/test/resources/mng-2222/mod-a/pom.xml create mode 100644 its/core-it-suite/src/test/resources/mng-2222/mod-b/pom.xml create mode 100644 its/core-it-suite/src/test/resources/mng-2222/pom.xml diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java b/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java index 7b77b6c88f..30b9e5c083 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java @@ -413,6 +413,7 @@ public class IntegrationTestSuite suite.addTestSuite( MavenITmng2254PomEncodingTest.class ); suite.addTestSuite( MavenITmng2234ActiveProfilesFromSettingsTest.class ); suite.addTestSuite( MavenITmng2228ComponentInjectionTest.class ); + suite.addTestSuite( MavenITmng2222OutputDirectoryReactorResolutionTest.class ); suite.addTestSuite( MavenITmng2201PluginConfigInterpolationTest.class ); suite.addTestSuite( MavenITmng2196ParentResolutionTest.class ); suite.addTestSuite( MavenITmng2174PluginDepsManagedByParentProfileTest.class ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2222OutputDirectoryReactorResolutionTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2222OutputDirectoryReactorResolutionTest.java new file mode 100644 index 0000000000..a3a79f7351 --- /dev/null +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2222OutputDirectoryReactorResolutionTest.java @@ -0,0 +1,65 @@ +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; +import java.util.List; + +/** + * This is a test set for MNG-2222. + * + * @author Benjamin Bentmann + */ +public class MavenITmng2222OutputDirectoryReactorResolutionTest + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng2222OutputDirectoryReactorResolutionTest() + { + super( "[3.0-alpha-8,)" ); + } + + /** + * Test that dependencies on reactor projects can be satisfied by their output directories even if those do not + * exist (e.g. due to non-existing sources). This ensures consistent build results for "mvn compile" and + * "mvn package". + */ + public void testit() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2222" ); + + Verifier verifier = new Verifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "mod-a/target" ); + verifier.deleteDirectory( "mod-b/target" ); + verifier.deleteArtifacts( "org.apache.maven.its.mng2222" ); + verifier.executeGoal( "compile" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + List classpath = verifier.loadLines( "mod-b/target/compile.txt", "UTF-8" ); + assertTrue( classpath.toString(), classpath.contains( "mod-a/target/classes" ) ); + } + +} diff --git a/its/core-it-suite/src/test/resources/mng-2222/mod-a/pom.xml b/its/core-it-suite/src/test/resources/mng-2222/mod-a/pom.xml new file mode 100644 index 0000000000..743d48d395 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-2222/mod-a/pom.xml @@ -0,0 +1,40 @@ + + + + + + 4.0.0 + + + org.apache.maven.its.mng2222 + parent + 1 + + + mod-a + 1 + + Maven Integration Test :: MNG-2222 :: Module A + + Test that dependencies on reactor projects can be satisfied by their output directories even if those do not + exist (e.g. due to non-existing sources). This ensures consistent build results for "mvn compile" and + "mvn package". + + diff --git a/its/core-it-suite/src/test/resources/mng-2222/mod-b/pom.xml b/its/core-it-suite/src/test/resources/mng-2222/mod-b/pom.xml new file mode 100644 index 0000000000..1ec98dad7b --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-2222/mod-b/pom.xml @@ -0,0 +1,71 @@ + + + + + + 4.0.0 + + + org.apache.maven.its.mng2222 + parent + 1 + + + mod-b + 1 + + Maven Integration Test :: MNG-2222 :: Module B + + Test that dependencies on reactor projects can be satisfied by their output directories even if those do not + exist (e.g. due to non-existing sources). This ensures consistent build results for "mvn compile" and + "mvn package". + + + + + org.apache.maven.its.mng2222 + mod-a + 1 + + + + + + + org.apache.maven.its.plugins + maven-it-plugin-dependency-resolution + 2.1-SNAPSHOT + + + compile-classpath + validate + + compile + + + target/compile.txt + 3 + + + + + + + diff --git a/its/core-it-suite/src/test/resources/mng-2222/pom.xml b/its/core-it-suite/src/test/resources/mng-2222/pom.xml new file mode 100644 index 0000000000..561df55b38 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-2222/pom.xml @@ -0,0 +1,58 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng2222 + parent + 1 + pom + + Maven Integration Test :: MNG-2222 + + Test that dependencies on reactor projects can be satisfied by their output directories even if those do not + exist (e.g. due to non-existing sources). This ensures consistent build results for "mvn compile" and + "mvn package". + + + + mod-a + mod-b + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 0.1-stub-SNAPSHOT + + + org.apache.maven.plugins + maven-resources-plugin + 0.1-stub-SNAPSHOT + + + + +