Author: bentmann Date: Tue Nov 17 23:05:46 2009 New Revision: 881609 URL: http://svn.apache.org/viewvc?rev=881609&view=rev Log: [MNG-4453] [regression] Plugin versions defined in a lifecycle mapping are not respected
o Added IT Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4453PluginVersionFromLifecycleMappingTest.java (with props) maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4453/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4453/pom.xml (with props) Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-packaging/src/main/resources/META-INF/plexus/components.xml Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java?rev=881609&r1=881608&r2=881609&view=diff ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java (original) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java Tue Nov 17 23:05:46 2009 @@ -85,6 +85,7 @@ // 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 ); Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4453PluginVersionFromLifecycleMappingTest.java URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4453PluginVersionFromLifecycleMappingTest.java?rev=881609&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4453PluginVersionFromLifecycleMappingTest.java (added) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4453PluginVersionFromLifecycleMappingTest.java Tue Nov 17 23:05:46 2009 @@ -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" ); + } + +} Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4453PluginVersionFromLifecycleMappingTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4453PluginVersionFromLifecycleMappingTest.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4453/pom.xml URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4453/pom.xml?rev=881609&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4453/pom.xml (added) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4453/pom.xml Tue Nov 17 23:05:46 2009 @@ -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> Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4453/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4453/pom.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Modified: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-packaging/src/main/resources/META-INF/plexus/components.xml URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-packaging/src/main/resources/META-INF/plexus/components.xml?rev=881609&r1=881608&r2=881609&view=diff ============================================================================== --- maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-packaging/src/main/resources/META-INF/plexus/components.xml (original) +++ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-packaging/src/main/resources/META-INF/plexus/components.xml Tue Nov 17 23:05:46 2009 @@ -33,6 +33,22 @@ </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> <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>