mirror of https://github.com/apache/maven.git
[MNG-4872] Dependency exclusions not always honored for dependencies with classifier
o Added IT git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@1026510 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e276c57be0
commit
cbc54d555d
|
@ -83,6 +83,7 @@ public class IntegrationTestSuite
|
||||||
// -------------------------------------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------------------------------------
|
||||||
// suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
|
// suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
|
||||||
|
|
||||||
|
suite.addTestSuite( MavenITmng4872ReactorResolutionAttachedWithExclusionsTest.class );
|
||||||
suite.addTestSuite( MavenITmng4842ParentResolutionOfDependencyPomTest.class );
|
suite.addTestSuite( MavenITmng4842ParentResolutionOfDependencyPomTest.class );
|
||||||
suite.addTestSuite( MavenITmng4834ParentProjectResolvedFromRemoteReposTest.class );
|
suite.addTestSuite( MavenITmng4834ParentProjectResolvedFromRemoteReposTest.class );
|
||||||
suite.addTestSuite( MavenITmng4829ChecksumFailureWarningTest.class );
|
suite.addTestSuite( MavenITmng4829ChecksumFailureWarningTest.class );
|
||||||
|
|
|
@ -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-4872">MNG-4872</a>.
|
||||||
|
*
|
||||||
|
* @author Benjamin Bentmann
|
||||||
|
*/
|
||||||
|
public class MavenITmng4872ReactorResolutionAttachedWithExclusionsTest
|
||||||
|
extends AbstractMavenIntegrationTestCase
|
||||||
|
{
|
||||||
|
|
||||||
|
public MavenITmng4872ReactorResolutionAttachedWithExclusionsTest()
|
||||||
|
{
|
||||||
|
super( "[3.0-beta-1,)" );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test that resolution of (attached) artifacts from the reactor doesn't cause exclusions to be lost.
|
||||||
|
*/
|
||||||
|
public void testit()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4872" );
|
||||||
|
|
||||||
|
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
|
||||||
|
verifier.setAutoclean( false );
|
||||||
|
verifier.deleteDirectory( "consumer/target" );
|
||||||
|
verifier.deleteArtifacts( "org.apache.maven.its.mng4872" );
|
||||||
|
verifier.executeGoal( "validate" );
|
||||||
|
verifier.verifyErrorFreeLog();
|
||||||
|
verifier.resetStreams();
|
||||||
|
|
||||||
|
List artifacts = verifier.loadLines( "consumer/target/artifacts.txt", "UTF-8" );
|
||||||
|
|
||||||
|
assertTrue( artifacts.toString(), artifacts.contains( "org.apache.maven.its.mng4872:producer:jar:0.1" ) );
|
||||||
|
assertTrue( artifacts.toString(), artifacts.contains( "org.apache.maven.its.mng4872:producer:jar:shaded:0.1" ) );
|
||||||
|
assertFalse( artifacts.toString(), artifacts.contains( "org.apache.maven.its.mng4872:excluded:jar:0.1" ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,85 @@
|
||||||
|
<?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.mng4872</groupId>
|
||||||
|
<artifactId>consumer</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<name>Maven Integration Test :: MNG-4872 :: Dependency Consumer</name>
|
||||||
|
<description>
|
||||||
|
Test that resolution of (attached) artifacts from the reactor doesn't cause exclusions to be lost.
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<!-- case 1: dependency on main project artifact -->
|
||||||
|
<groupId>org.apache.maven.its.mng4872</groupId>
|
||||||
|
<artifactId>producer</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.apache.maven.its.mng4872</groupId>
|
||||||
|
<artifactId>excluded</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<!-- case 2: dependency on attached project artifact -->
|
||||||
|
<groupId>org.apache.maven.its.mng4872</groupId>
|
||||||
|
<artifactId>producer</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
<classifier>shaded</classifier>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.apache.maven.its.mng4872</groupId>
|
||||||
|
<artifactId>excluded</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</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>
|
||||||
|
<projectArtifacts>target/artifacts.txt</projectArtifacts>
|
||||||
|
<significantPathLevels>1</significantPathLevels>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>resolve</id>
|
||||||
|
<phase>validate</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>compile</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
|
@ -0,0 +1,39 @@
|
||||||
|
<?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.mng4872</groupId>
|
||||||
|
<artifactId>aggregator</artifactId>
|
||||||
|
<version>0.1-SNAPSHOT</version>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
|
<name>Maven Integration Test :: MNG-4872</name>
|
||||||
|
<description>
|
||||||
|
Test that resolution of (attached) artifacts from the reactor doesn't cause exclusions to be lost.
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<modules>
|
||||||
|
<module>producer</module>
|
||||||
|
<module>consumer</module>
|
||||||
|
</modules>
|
||||||
|
</project>
|
|
@ -0,0 +1,69 @@
|
||||||
|
<?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.mng4872</groupId>
|
||||||
|
<artifactId>producer</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<name>Maven Integration Test :: MNG-4872 :: Dependency Producer</name>
|
||||||
|
<description>
|
||||||
|
Test that resolution of (attached) artifacts from the reactor doesn't cause exclusions to be lost.
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<!-- doesn't actually exist, the exclusions in the consumer should prevent it from causing troubles -->
|
||||||
|
<groupId>org.apache.maven.its.mng4872</groupId>
|
||||||
|
<artifactId>excluded</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.its.plugins</groupId>
|
||||||
|
<artifactId>maven-it-plugin-artifact</artifactId>
|
||||||
|
<version>2.1-SNAPSHOT</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>package</id>
|
||||||
|
<phase>validate</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>set</goal>
|
||||||
|
<goal>attach</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<mainFile>pom.xml</mainFile>
|
||||||
|
<attachedFile>pom.xml</attachedFile>
|
||||||
|
<artifactType>jar</artifactType>
|
||||||
|
<artifactClassifier>shaded</artifactClassifier>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
Loading…
Reference in New Issue