[MNG-4453] [regression] Plugin versions defined in a lifecycle mapping are not respected

o Added IT

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@881609 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-11-17 23:05:46 +00:00
parent df196bc14e
commit f6869fab4b
4 changed files with 123 additions and 0 deletions

View File

@ -85,6 +85,7 @@ public class IntegrationTestSuite
// suite.addTestSuite( MavenIT0109ReleaseUpdateTest.class );
// suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
suite.addTestSuite( MavenITmng4453PluginVersionFromLifecycleMappingTest.class );
suite.addTestSuite( MavenITmng4450StubModelForMissingDependencyPomTest.class );
suite.addTestSuite( MavenITmng4448FollowHttpRedirectTest.class );
suite.addTestSuite( MavenITmng4436SingletonComponentLookupTest.class );

View File

@ -0,0 +1,60 @@
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-4453">MNG-4453</a>.
*
* @author Benjamin Bentmann
*/
public class MavenITmng4453PluginVersionFromLifecycleMappingTest
extends AbstractMavenIntegrationTestCase
{
public MavenITmng4453PluginVersionFromLifecycleMappingTest()
{
super( "[2.0.3,3.0-alpha-1)" );
}
/**
* Verify that plugin versions given by the lifecycle mapping are respected, even if those differ from the version
* defined in the plugin management section inherited from the super POM.
*/
public void testit()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4453" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteDirectory( "target" );
verifier.executeGoal( "process-resources" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
verifier.assertFilePresent( "target/resources-resources.txt" );
}
}

View File

@ -0,0 +1,46 @@
<?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.mng4453</groupId>
<artifactId>test</artifactId>
<version>0.1</version>
<packaging>versioned-plugin</packaging>
<name>Maven Integration Test :: MNG-4453</name>
<description>
Verify that plugin versions given by the lifecycle mapping are respected, even if those differ from the version
defined in the plugin management section inherited from the super POM.
</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-packaging</artifactId>
<version>2.1-SNAPSHOT</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>

View File

@ -32,6 +32,22 @@
</lifecycles>
</configuration>
</component>
<component>
<role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
<role-hint>versioned-plugin</role-hint>
<implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
<configuration>
<lifecycles>
<lifecycle>
<id>default</id>
<phases>
<!-- NOTE: Using a plugin that is subject to the super POM defaults is essential -->
<process-resources>org.apache.maven.plugins:maven-resources-plugin:0.1-stub-SNAPSHOT:resources</process-resources>
</phases>
</lifecycle>
</lifecycles>
</configuration>
</component>
<component>
<role>org.apache.maven.artifact.handler.ArtifactHandler</role>
<role-hint>it-artifact</role-hint>