Author: bentmann Date: Fri Sep 3 13:39:12 2010 New Revision: 992294 URL: http://svn.apache.org/viewvc?rev=992294&view=rev Log: [MNG-4789] [regression] Difference in compile scope dependency resolution
o Added IT Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4789ScopeInheritanceMeetsConflictTest.java (with props) maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/pom.xml (with props) maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/a/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/a/0.1/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/a/0.1/a-0.1.jar (with props) maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/a/0.1/a-0.1.pom maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/b/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/b/0.1/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/b/0.1/b-0.1.jar (with props) maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/b/0.1/b-0.1.pom maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/x/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/x/0.1/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/x/0.1/x-0.1.jar (with props) maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/x/0.1/x-0.1.pom maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/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=992294&r1=992293&r2=992294&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 Fri Sep 3 13:39:12 2010 @@ -82,6 +82,7 @@ public class IntegrationTestSuite // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137 suite.addTestSuite( MavenITmng4791ProjectBuilderResolvesRemotePomArtifactTest.class ); + suite.addTestSuite( MavenITmng4789ScopeInheritanceMeetsConflictTest.class ); suite.addTestSuite( MavenITmng4786AntBased21xMojoSupportTest.class ); suite.addTestSuite( MavenITmng4781DeploymentToNexusStagingRepoTest.class ); suite.addTestSuite( MavenITmng4779MultipleDepsWithVersionRangeFromLocalRepoTest.class ); Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4789ScopeInheritanceMeetsConflictTest.java URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4789ScopeInheritanceMeetsConflictTest.java?rev=992294&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4789ScopeInheritanceMeetsConflictTest.java (added) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4789ScopeInheritanceMeetsConflictTest.java Fri Sep 3 13:39:12 2010 @@ -0,0 +1,79 @@ +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; +import java.util.Properties; + +/** + * This is a test set for <a href="http://jira.codehaus.org/browse/MNG-4789">MNG-4789</a>. + * + * @author Benjamin Bentmann + */ +public class MavenITmng4789ScopeInheritanceMeetsConflictTest + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng4789ScopeInheritanceMeetsConflictTest() + { + super( "[2.0.3,3.0-alpha-1),[3.0-beta-4,)" ); + } + + /** + * Test that scope inheritance considers the effective scope of parent nodes as enforced by direct dependency + * declarations. + */ + public void testit() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4789" ); + + Verifier verifier = newVerifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteArtifacts( "org.apache.maven.its.mng4789" ); + verifier.deleteDirectory( "target" ); + verifier.getCliOptions().add( "-s" ); + verifier.getCliOptions().add( "settings.xml" ); + verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() ); + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + List compile = verifier.loadLines( "target/compile.txt", "UTF-8" ); + assertFalse( compile.toString(), compile.contains( "a-0.1.jar" ) ); + assertTrue( compile.toString(), compile.contains( "b-0.1.jar" ) ); + assertFalse( compile.toString(), compile.contains( "x-0.1.jar" ) ); + + List runtime = verifier.loadLines( "target/runtime.txt", "UTF-8" ); + assertFalse( runtime.toString(), runtime.contains( "a-0.1.jar" ) ); + assertTrue( runtime.toString(), runtime.contains( "b-0.1.jar" ) ); + assertFalse( runtime.toString(), runtime.contains( "x-0.1.jar" ) ); + + List test = verifier.loadLines( "target/test.txt", "UTF-8" ); + assertTrue( test.toString(), test.contains( "a-0.1.jar" ) ); + assertTrue( test.toString(), test.contains( "b-0.1.jar" ) ); + assertTrue( test.toString(), test.contains( "x-0.1.jar" ) ); + } + +} Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4789ScopeInheritanceMeetsConflictTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4789ScopeInheritanceMeetsConflictTest.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/pom.xml URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/pom.xml?rev=992294&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/pom.xml (added) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/pom.xml Fri Sep 3 13:39:12 2010 @@ -0,0 +1,87 @@ +<?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.mng4789</groupId> + <artifactId>test</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: MNG-4789</name> + <description> + Test that scope inheritance considers the effective scope of parent nodes as enforced by direct dependency + declarations. + </description> + + <dependencies> + <!-- + test + +- a:test + | \- x:test + \- b:compile + \- a:compile + \- x:compile + + What's the effective scope for x? + --> + <dependency> + <groupId>org.apache.maven.its.mng4789</groupId> + <artifactId>a</artifactId> + <version>0.1</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.maven.its.mng4789</groupId> + <artifactId>b</artifactId> + <version>0.1</version> + <scope>compile</scope> + </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/compile.txt</compileClassPath> + <runtimeClassPath>target/runtime.txt</runtimeClassPath> + <testClassPath>target/test.txt</testClassPath> + <significantPathLevels>1</significantPathLevels> + </configuration> + <executions> + <execution> + <id>resolve</id> + <phase>validate</phase> + <goals> + <goal>compile</goal> + <goal>runtime</goal> + <goal>test</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/pom.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/a/0.1/a-0.1.jar URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/a/0.1/a-0.1.jar?rev=992294&view=auto ============================================================================== Binary file - no diff available. Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/a/0.1/a-0.1.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/a/0.1/a-0.1.pom URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/a/0.1/a-0.1.pom?rev=992294&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/a/0.1/a-0.1.pom (added) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/a/0.1/a-0.1.pom Fri Sep 3 13:39:12 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> + + <groupId>org.apache.maven.its.mng4789</groupId> + <artifactId>a</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <dependencies> + <dependency> + <groupId>org.apache.maven.its.mng4789</groupId> + <artifactId>x</artifactId> + <version>0.1</version> + <scope>compile</scope> + </dependency> + </dependencies> + + <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-4789/repo/org/apache/maven/its/mng4789/b/0.1/b-0.1.jar URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/b/0.1/b-0.1.jar?rev=992294&view=auto ============================================================================== Binary file - no diff available. Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/b/0.1/b-0.1.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/b/0.1/b-0.1.pom URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/b/0.1/b-0.1.pom?rev=992294&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/b/0.1/b-0.1.pom (added) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/b/0.1/b-0.1.pom Fri Sep 3 13:39:12 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> + + <groupId>org.apache.maven.its.mng4789</groupId> + <artifactId>b</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <dependencies> + <dependency> + <groupId>org.apache.maven.its.mng4789</groupId> + <artifactId>a</artifactId> + <version>0.1</version> + <scope>compile</scope> + </dependency> + </dependencies> + + <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-4789/repo/org/apache/maven/its/mng4789/x/0.1/x-0.1.jar URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/x/0.1/x-0.1.jar?rev=992294&view=auto ============================================================================== Binary file - no diff available. Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/x/0.1/x-0.1.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/x/0.1/x-0.1.pom URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/x/0.1/x-0.1.pom?rev=992294&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/x/0.1/x-0.1.pom (added) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/repo/org/apache/maven/its/mng4789/x/0.1/x-0.1.pom Fri Sep 3 13:39:12 2010 @@ -0,0 +1,36 @@ +<?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.mng4789</groupId> + <artifactId>x</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <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-4789/settings-template.xml URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/settings-template.xml?rev=992294&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/settings-template.xml (added) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/settings-template.xml Fri Sep 3 13:39:12 2010 @@ -0,0 +1,55 @@ +<?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-repo</id> + <url>@baseurl@/repo</url> + <releases> + <checksumPolicy>ignore</checksumPolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>maven-core-it-repo</id> + <url>@baseurl@/repo</url> + <releases> + <checksumPolicy>ignore</checksumPolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + </profile> + </profiles> + <activeProfiles> + <activeProfile>maven-core-it-repo</activeProfile> + </activeProfiles> +</settings> Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/settings-template.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4789/settings-template.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision