mirror of
https://github.com/apache/maven.git
synced 2025-02-23 10:45:27 +00:00
[MNG-4789] [regression] Difference in compile scope dependency resolution
o Added IT git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@992294 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
dccd30bf17
commit
78debe8e47
@ -82,6 +82,7 @@ public static Test suite()
|
||||
// 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 );
|
||||
|
@ -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" ) );
|
||||
}
|
||||
|
||||
}
|
87
its/core-it-suite/src/test/resources/mng-4789/pom.xml
Normal file
87
its/core-it-suite/src/test/resources/mng-4789/pom.xml
Normal file
@ -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>
|
Binary file not shown.
@ -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>
|
Binary file not shown.
@ -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>
|
Binary file not shown.
@ -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>
|
@ -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>
|
Loading…
x
Reference in New Issue
Block a user