[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
This commit is contained in:
Benjamin Bentmann 2010-03-26 20:59:43 +00:00
parent 80bd86f643
commit b1880e6671
5 changed files with 235 additions and 0 deletions

View File

@ -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 );

View File

@ -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 <a href="http://jira.codehaus.org/browse/MNG-2222">MNG-2222</a>.
*
* @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" ) );
}
}

View File

@ -0,0 +1,40 @@
<?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>
<groupId>org.apache.maven.its.mng2222</groupId>
<artifactId>parent</artifactId>
<version>1</version>
</parent>
<artifactId>mod-a</artifactId>
<version>1</version>
<name>Maven Integration Test :: MNG-2222 :: Module A</name>
<description>
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".
</description>
</project>

View File

@ -0,0 +1,71 @@
<?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>
<groupId>org.apache.maven.its.mng2222</groupId>
<artifactId>parent</artifactId>
<version>1</version>
</parent>
<artifactId>mod-b</artifactId>
<version>1</version>
<name>Maven Integration Test :: MNG-2222 :: Module B</name>
<description>
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".
</description>
<dependencies>
<dependency>
<groupId>org.apache.maven.its.mng2222</groupId>
<artifactId>mod-a</artifactId>
<version>1</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>
<executions>
<execution>
<id>compile-classpath</id>
<phase>validate</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<compileClassPath>target/compile.txt</compileClassPath>
<significantPathLevels>3</significantPathLevels>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,58 @@
<?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.mng2222</groupId>
<artifactId>parent</artifactId>
<version>1</version>
<packaging>pom</packaging>
<name>Maven Integration Test :: MNG-2222</name>
<description>
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".
</description>
<modules>
<module>mod-a</module>
<module>mod-b</module>
</modules>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>0.1-stub-SNAPSHOT</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>0.1-stub-SNAPSHOT</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>