[MNG-4895] Plugins depending on 3rd party JARs that contain the Maven API can't be configured/run due to type incompatibilities

o Added IT

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@1034879 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2010-11-13 21:07:50 +00:00
parent e1baefaaf0
commit 5274768c8c
6 changed files with 237 additions and 0 deletions

View File

@ -83,6 +83,7 @@ public class IntegrationTestSuite
// -------------------------------------------------------------------------------------------------------------
// suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
suite.addTestSuite( MavenITmng4895PluginDepWithNonRelocatedMavenApiTest.class );
suite.addTestSuite( MavenITmng4891RobustSnapshotResolutionTest.class );
//suite.addTestSuite( MavenITmng4883FailUponOverconstrainedVersionRangesTest.class );
suite.addTestSuite( MavenITmng4877DeployUsingPrivateKeyTest.class );

View File

@ -0,0 +1,64 @@
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;
/**
* This is a test set for <a href="http://jira.codehaus.org/browse/MNG-4895">MNG-4895</a>.
*
* @author Benjamin Bentmann
*/
public class MavenITmng4895PluginDepWithNonRelocatedMavenApiTest
extends AbstractMavenIntegrationTestCase
{
public MavenITmng4895PluginDepWithNonRelocatedMavenApiTest()
{
super( "[3.0.1,)" );
}
/**
* Verify that the classes constituting the Maven API are always loaded from the Maven core realm even if the plugin
* realm contains a 3rd party dependency that contains (non-relocated) duplicates of API classes.
*/
public void testit()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4895" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteDirectory( "target" );
verifier.deleteArtifacts( "org.apache.maven.its.mng4895" );
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();
verifier.assertFilePresent( "target/classpath.txt" );
}
}

View File

@ -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.mng4895</groupId>
<artifactId>test</artifactId>
<version>0.1</version>
<packaging>jar</packaging>
<name>Maven Integration Test :: MNG-4895</name>
<description>
Verify that the classes constituting the Maven API are always loaded from the Maven core realm even if the plugin
realm contains a 3rd party dependency that contains (non-relocated) duplicates of API classes.
</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-dependency-resolution</artifactId>
<version>2.1-SNAPSHOT</version>
<dependencies>
<dependency>
<!-- This JAR contains stubs of essential classes of the Maven API, they must not get used -->
<groupId>org.apache.maven.its.mng4895</groupId>
<artifactId>mvnapi</artifactId>
<version>0.1</version>
</dependency>
</dependencies>
<configuration>
<compileClassPath>target/classpath.txt</compileClassPath>
<significantPathLevels>1</significantPathLevels>
</configuration>
<executions>
<execution>
<id>resolve</id>
<phase>validate</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,51 @@
<?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.mng4895</groupId>
<artifactId>mvnapi</artifactId>
<version>0.1</version>
<packaging>jar</packaging>
<distributionManagement>
<repository>
<id>maven-core-it</id>
<url>file:///${basedir}/repo</url>
</repository>
</distributionManagement>
<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>

View File

@ -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</id>
<url>@baseurl@/repo</url>
<releases>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>maven-core-it</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>