mirror of https://github.com/apache/maven.git
[MNG-3890] Transitive dependencies override explicitly set scope
o Added IT git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@724015 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4810ffa73e
commit
c0655913ab
|
@ -73,6 +73,7 @@ public class IntegrationTestSuite
|
||||||
// -------------------------------------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------------------------------------
|
||||||
// Tests that currently don't pass for any Maven version, i.e. the corresponding issue hasn't been resolved yet
|
// Tests that currently don't pass for any Maven version, i.e. the corresponding issue hasn't been resolved yet
|
||||||
// -------------------------------------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------------------------------------
|
||||||
|
// suite.addTestSuite( MavenITmng3890TransitiveDependencyScopeUpdateTest.class );
|
||||||
// suite.addTestSuite( MavenITmng3814BogusProjectCycleTest.class );
|
// suite.addTestSuite( MavenITmng3814BogusProjectCycleTest.class );
|
||||||
// suite.addTestSuite( MavenITmng3645POMSyntaxErrorTest.class );
|
// suite.addTestSuite( MavenITmng3645POMSyntaxErrorTest.class );
|
||||||
// suite.addTestSuite( MavenITmng3391ImportScopeErrorScenariosTest.class );
|
// suite.addTestSuite( MavenITmng3391ImportScopeErrorScenariosTest.class );
|
||||||
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
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-3890">MNG-3890</a>.
|
||||||
|
*
|
||||||
|
* @author Benjamin Bentmann
|
||||||
|
* @version $Id$
|
||||||
|
*/
|
||||||
|
public class MavenITmng3890TransitiveDependencyScopeUpdateTest
|
||||||
|
extends AbstractMavenIntegrationTestCase
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test that transitive dependencies whose scope has been updated from "compile" to "provided" by a consumer
|
||||||
|
* remain in "provided" scope when depending on this consumer with scope "compile".
|
||||||
|
*/
|
||||||
|
public void testitMNG3890()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3890" );
|
||||||
|
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
|
||||||
|
verifier.setAutoclean( false );
|
||||||
|
verifier.deleteDirectory( "target" );
|
||||||
|
verifier.deleteArtifacts( "org.apache.maven.its.mng3890" );
|
||||||
|
verifier.executeGoal( "validate" );
|
||||||
|
verifier.verifyErrorFreeLog();
|
||||||
|
verifier.resetStreams();
|
||||||
|
|
||||||
|
List artifacts = verifier.loadLines( "target/artifacts.txt", "UTF-8" );
|
||||||
|
assertTrue( artifacts.toString(), artifacts.contains( "org.apache.maven.its.mng3890:c:jar:0.1" ) );
|
||||||
|
assertTrue( artifacts.toString(), artifacts.contains( "org.apache.maven.its.mng3890:b:jar:0.1" ) );
|
||||||
|
assertFalse( artifacts.toString(), artifacts.contains( "org.apache.maven.its.mng3890:a:jar:0.1" ) );
|
||||||
|
assertEquals( 2, artifacts.size() );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,97 @@
|
||||||
|
<?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.mng3890</groupId>
|
||||||
|
<artifactId>test</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
|
||||||
|
<name>Maven Integration Test :: MNG-3890</name>
|
||||||
|
<description>
|
||||||
|
Test that transitive dependencies whose scope has been updated from "compile" to "provided" by a consumer
|
||||||
|
remain in "provided" scope when depending on this consumer with scope "compile".
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<!-- Below are the dependency trees for the artifacts of this test with Maven 2.0.9:
|
||||||
|
[INFO] ------------------------------------------------------------------------
|
||||||
|
[INFO] [dependency:tree]
|
||||||
|
[INFO] org.apache.maven.its.mng3890:b:jar:0.1
|
||||||
|
[INFO] \- org.apache.maven.its.mng3890:a:jar:0.1:compile
|
||||||
|
[INFO] ------------------------------------------------------------------------
|
||||||
|
[INFO] [dependency:tree]
|
||||||
|
[INFO] org.apache.maven.its.mng3890:c:jar:0.1
|
||||||
|
[INFO] +- org.apache.maven.its.mng3890:a:jar:0.1:provided (scope not updated to compile)
|
||||||
|
[INFO] \- org.apache.maven.its.mng3890:b:jar:0.1:compile
|
||||||
|
[INFO] ------------------------------------------------------------------------
|
||||||
|
[INFO] [dependency:tree]
|
||||||
|
[INFO] org.apache.maven.its.mng3890:test:jar:1.0
|
||||||
|
[INFO] \- org.apache.maven.its.mng3890:c:jar:0.1:compile
|
||||||
|
[INFO] \- org.apache.maven.its.mng3890:b:jar:0.1:compile
|
||||||
|
[INFO] \- org.apache.maven.its.mng3890:a:jar:0.1:compile << ERROR: Should be excluded because declared as provided by c
|
||||||
|
[INFO] ------------------------------------------------------------------------
|
||||||
|
-->
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>maven-core-it</id>
|
||||||
|
<url>file:///${basedir}/repo</url>
|
||||||
|
<releases>
|
||||||
|
<checksumPolicy>ignore</checksumPolicy>
|
||||||
|
</releases>
|
||||||
|
<snapshots>
|
||||||
|
<checksumPolicy>ignore</checksumPolicy>
|
||||||
|
</snapshots>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.maven.its.mng3890</groupId>
|
||||||
|
<artifactId>c</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>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>test</id>
|
||||||
|
<phase>validate</phase>
|
||||||
|
<configuration>
|
||||||
|
<testArtifacts>target/artifacts.txt</testArtifacts>
|
||||||
|
</configuration>
|
||||||
|
<goals>
|
||||||
|
<goal>test</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
Binary file not shown.
|
@ -0,0 +1,60 @@
|
||||||
|
<?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.mng3890</groupId>
|
||||||
|
<artifactId>a</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<distributionManagement>
|
||||||
|
<repository>
|
||||||
|
<id>maven-core-it</id>
|
||||||
|
<url>file:///${basedir}/repo</url>
|
||||||
|
<uniqueVersion>true</uniqueVersion>
|
||||||
|
</repository>
|
||||||
|
</distributionManagement>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.test.skip>true</maven.test.skip>
|
||||||
|
<updateReleaseInfo>true</updateReleaseInfo>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>.</directory>
|
||||||
|
<includes>
|
||||||
|
<include>pom.xml</include>
|
||||||
|
<include>src/**</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</build>
|
||||||
|
</project>
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?><metadata>
|
||||||
|
<groupId>org.apache.maven.its.mng3890</groupId>
|
||||||
|
<artifactId>a</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
<versioning>
|
||||||
|
<release>0.1</release>
|
||||||
|
<versions>
|
||||||
|
<version>0.1</version>
|
||||||
|
</versions>
|
||||||
|
<lastUpdated>20081206164039</lastUpdated>
|
||||||
|
</versioning>
|
||||||
|
</metadata>
|
Binary file not shown.
|
@ -0,0 +1,66 @@
|
||||||
|
<?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.mng3890</groupId>
|
||||||
|
<artifactId>b</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<distributionManagement>
|
||||||
|
<repository>
|
||||||
|
<id>maven-core-it</id>
|
||||||
|
<url>file:///${basedir}/repo</url>
|
||||||
|
<uniqueVersion>true</uniqueVersion>
|
||||||
|
</repository>
|
||||||
|
</distributionManagement>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.test.skip>true</maven.test.skip>
|
||||||
|
<updateReleaseInfo>true</updateReleaseInfo>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.maven.its.mng3890</groupId>
|
||||||
|
<artifactId>a</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>.</directory>
|
||||||
|
<includes>
|
||||||
|
<include>pom.xml</include>
|
||||||
|
<include>src/**</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</build>
|
||||||
|
</project>
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?><metadata>
|
||||||
|
<groupId>org.apache.maven.its.mng3890</groupId>
|
||||||
|
<artifactId>b</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
<versioning>
|
||||||
|
<release>0.1</release>
|
||||||
|
<versions>
|
||||||
|
<version>0.1</version>
|
||||||
|
</versions>
|
||||||
|
<lastUpdated>20081206164247</lastUpdated>
|
||||||
|
</versioning>
|
||||||
|
</metadata>
|
Binary file not shown.
|
@ -0,0 +1,72 @@
|
||||||
|
<?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.mng3890</groupId>
|
||||||
|
<artifactId>c</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<distributionManagement>
|
||||||
|
<repository>
|
||||||
|
<id>maven-core-it</id>
|
||||||
|
<url>file:///${basedir}/repo</url>
|
||||||
|
<uniqueVersion>true</uniqueVersion>
|
||||||
|
</repository>
|
||||||
|
</distributionManagement>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.test.skip>true</maven.test.skip>
|
||||||
|
<updateReleaseInfo>true</updateReleaseInfo>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.maven.its.mng3890</groupId>
|
||||||
|
<artifactId>a</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.maven.its.mng3890</groupId>
|
||||||
|
<artifactId>b</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>.</directory>
|
||||||
|
<includes>
|
||||||
|
<include>pom.xml</include>
|
||||||
|
<include>src/**</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</build>
|
||||||
|
</project>
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?><metadata>
|
||||||
|
<groupId>org.apache.maven.its.mng3890</groupId>
|
||||||
|
<artifactId>c</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
<versioning>
|
||||||
|
<release>0.1</release>
|
||||||
|
<versions>
|
||||||
|
<version>0.1</version>
|
||||||
|
</versions>
|
||||||
|
<lastUpdated>20081206164405</lastUpdated>
|
||||||
|
</versioning>
|
||||||
|
</metadata>
|
Loading…
Reference in New Issue