[MNG-4274] Plugins with an undeclared but transitive dependency on plexus-utils via a core artifact get wrong version of p-u

o Strengthened IT

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@800061 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-08-02 13:05:44 +00:00
parent a1a0bb1339
commit fcd32c20f3
9 changed files with 184 additions and 13 deletions

View File

@ -23,8 +23,6 @@ import org.apache.maven.it.Verifier;
import org.apache.maven.it.util.ResourceExtractor;
import java.io.File;
import java.util.Arrays;
import java.util.Collection;
import java.util.Properties;
/**
@ -38,7 +36,7 @@ public class MavenITmng4274PluginRealmArtifactsTest
public MavenITmng4274PluginRealmArtifactsTest()
{
super( "[2.0.6,)" );
super( "[3.0-alpha-3,)" );
}
/**
@ -53,15 +51,20 @@ public class MavenITmng4274PluginRealmArtifactsTest
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteDirectory( "target" );
verifier.deleteArtifact( "org.apache.maven", "maven-core", "2.0.4274", "jar" );
verifier.deleteArtifact( "org.apache.maven", "maven-core", "2.0.4274", "pom" );
verifier.deleteArtifact( "org.codehaus.plexus", "plexus-utils", "1.1.4274", "jar" );
verifier.deleteArtifact( "org.codehaus.plexus", "plexus-utils", "1.1.4274", "pom" );
verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() );
verifier.getCliOptions().add( "-s" );
verifier.getCliOptions().add( "settings.xml" );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
Properties props = verifier.loadProperties( "target/class.properties" );
String prop = props.getProperty( "org.codehaus.plexus.util.Expand.methods", "" );
Collection methods = Arrays.asList( prop.split( "," ) );
assertTrue( methods.toString(), methods.contains( "normalize" ) );
assertTrue( methods.toString(), methods.contains( "resolveFile" ) );
assertNotNull( props.getProperty( "org.apache.maven.its.mng4274.CoreIt" ) );
}
}

View File

@ -25,7 +25,7 @@ under the License.
<groupId>org.apache.maven.its.mng4274</groupId>
<artifactId>test</artifactId>
<version>0.1</version>
<packaging>maven-plugin</packaging>
<packaging>jar</packaging>
<name>Maven Integration Test :: MNG-4274</name>
<description>
@ -42,16 +42,16 @@ under the License.
<version>2.1-SNAPSHOT</version>
<dependencies>
<dependency>
<!-- NOTE: This depends on plexus-utils:1.0.4 -->
<!-- NOTE: This has a dependency on our plexus-utils stub version 1.1.4274 -->
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
<version>2.0</version>
<artifactId>maven-core</artifactId>
<version>2.0.4274</version>
</dependency>
</dependencies>
<configuration>
<pluginClassLoaderOutput>target/class.properties</pluginClassLoaderOutput>
<!-- NOTE: In newer version of plexus-utils, methods have been removed from this class -->
<classNames>org.codehaus.plexus.util.Expand</classNames>
<!-- This class is provided by our plexus-utils stub -->
<classNames>org.apache.maven.its.mng4274.CoreIt</classNames>
</configuration>
<executions>
<execution>

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</groupId>
<artifactId>maven-core</artifactId>
<version>2.0.4274</version>
<packaging>jar</packaging>
<name>Maven Integration Test :: MNG-4274 :: Maven Core Stub</name>
<description>
A stub version of some Maven core artifact, i.e. an artifact to be excluded from a plugin realm, that itself
depends on the stub version of plexus-utils. This mimics the dependency of maven-project:2.0 on
plexus-utils:1.0.4 for instance.
</description>
<distributionManagement>
<repository>
<id>maven-core-it</id>
<url>file:///${basedir}/repo</url>
</repository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>1.1.4274</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>2.0.4274</version>
<versioning>
<release>2.0.4274</release>
<versions>
<version>2.0.4274</version>
</versions>
<lastUpdated>20090802122327</lastUpdated>
</versioning>
</metadata>

View File

@ -0,0 +1,56 @@
<?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.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>1.1.4274</version>
<packaging>jar</packaging>
<name>Maven Integration Test :: MNG-4274 :: Plexus Utils Stub</name>
<description>
A stub version of plexus-utils, must have the same groupId:artifactId as the real thing.
</description>
<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,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>1.1.4274</version>
<versioning>
<release>1.1.4274</release>
<versions>
<version>1.1.4274</version>
</versions>
<lastUpdated>20090802121446</lastUpdated>
</versioning>
</metadata>

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>