From 483438a49b9a66c5b7c401c3c1ad28efbe82dcb3 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Mon, 7 Dec 2009 00:08:10 +0000 Subject: [PATCH] [MNG-4479] [regression] Project-level plugin dependencies ignored for direct CLI invocation if plugin key uses properties o Added IT git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@887807 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/it/IntegrationTestSuite.java | 1 + ...ectLevelPluginDepUsedForCliConfigTest.java | 69 +++++++++++++++++ .../src/test/resources/mng-4479/pom.xml | 71 ++++++++++++++++++ .../maven/its/mng4479/dep/0.1/dep-0.1.jar | Bin 0 -> 6028 bytes .../maven/its/mng4479/dep/0.1/dep-0.1.pom | 62 +++++++++++++++ .../maven/its/mng4479/dep/maven-metadata.xml | 12 +++ .../resources/mng-4479/settings-template.xml | 55 ++++++++++++++ 7 files changed, 270 insertions(+) create mode 100644 its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4479ProjectLevelPluginDepUsedForCliConfigTest.java create mode 100644 its/core-it-suite/src/test/resources/mng-4479/pom.xml create mode 100644 its/core-it-suite/src/test/resources/mng-4479/repo/org/apache/maven/its/mng4479/dep/0.1/dep-0.1.jar create mode 100644 its/core-it-suite/src/test/resources/mng-4479/repo/org/apache/maven/its/mng4479/dep/0.1/dep-0.1.pom create mode 100644 its/core-it-suite/src/test/resources/mng-4479/repo/org/apache/maven/its/mng4479/dep/maven-metadata.xml create mode 100644 its/core-it-suite/src/test/resources/mng-4479/settings-template.xml diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java b/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java index 2884acbe3d..af1dab339e 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java @@ -86,6 +86,7 @@ public class IntegrationTestSuite // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137 suite.addTestSuite( MavenITmng4482ForcePluginSnapshotUpdateTest.class ); + suite.addTestSuite( MavenITmng4479ProjectLevelPluginDepUsedForCliConfigTest.class ); suite.addTestSuite( MavenITmng4474PerLookupWagonInstantiationTest.class ); suite.addTestSuite( MavenITmng4470AuthenticatedDeploymentToProxyTest.class ); suite.addTestSuite( MavenITmng4469AuthenticatedDeploymentToCustomRepoTest.class ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4479ProjectLevelPluginDepUsedForCliConfigTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4479ProjectLevelPluginDepUsedForCliConfigTest.java new file mode 100644 index 0000000000..f2404b9beb --- /dev/null +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4479ProjectLevelPluginDepUsedForCliConfigTest.java @@ -0,0 +1,69 @@ +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.FileUtils; +import org.apache.maven.it.util.ResourceExtractor; + +import java.io.File; +import java.util.Properties; + +/** + * This is a test set for MNG-4479. + * + * @author Benjamin Bentmann + */ +public class MavenITmng4479ProjectLevelPluginDepUsedForCliConfigTest + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng4479ProjectLevelPluginDepUsedForCliConfigTest() + { + super( "[2.0.3,2.0.99),[3.0-alpha-2,)" ); + } + + /** + * Verify that project-level plugin dependencies are used for direct invocations of the plugin and that they + * can contribute classes required for the plugin configuration when the plugin is declared using properties + * for its key. + */ + public void testit() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4479" ); + + Verifier verifier = new Verifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); + verifier.deleteArtifacts( "org.apache.maven.its.mng4479" ); + verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() ); + verifier.getCliOptions().add( "-s" ); + verifier.getCliOptions().add( "settings.xml" ); + verifier.executeGoal( "org.apache.maven.its.plugins:maven-it-plugin-parameter-implementation:2.1-SNAPSHOT:param-implementation" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + Properties props = verifier.loadProperties( "target/param.properties" ); + assertEquals( "org.apache.maven.plugin.coreit.ItImpl-passed", props.getProperty( "theParameter.string" ) ); + assertEquals( "org.apache.maven.plugin.coreit.ItImpl", props.getProperty( "theParameter.class" ) ); + } + +} diff --git a/its/core-it-suite/src/test/resources/mng-4479/pom.xml b/its/core-it-suite/src/test/resources/mng-4479/pom.xml new file mode 100644 index 0000000000..615ab811ee --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4479/pom.xml @@ -0,0 +1,71 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4479 + test + 0.1 + jar + + Maven Integration Test :: MNG-4479 + + Verify that project-level plugin dependencies are used for direct invocations of the plugin and that they + can contribute classes required for the plugin configuration when the plugin is declared using properties + for its key. + + + + org.apache.maven.its.plugins + maven-it-plugin-parameter-implementation + + + + + + + ${pluginGroupId} + ${pluginArtifactId} + 2.1-SNAPSHOT + + target/param.properties + + + passed + + + + + org.apache.maven.its.mng4479 + dep + 0.1 + + + + + + maven-resources-plugin + 2.1 + + + + diff --git a/its/core-it-suite/src/test/resources/mng-4479/repo/org/apache/maven/its/mng4479/dep/0.1/dep-0.1.jar b/its/core-it-suite/src/test/resources/mng-4479/repo/org/apache/maven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ven-core-it + file:///${basedir}/repo + + + + + + org.apache.maven.its.plugins + maven-it-plugin-parameter-implementation + 2.1-SNAPSHOT + provided + + + + + + + . + + pom.xml + src/** + + + + src/main/resources + + + + diff --git a/its/core-it-suite/src/test/resources/mng-4479/repo/org/apache/maven/its/mng4479/dep/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-4479/repo/org/apache/maven/its/mng4479/dep/maven-metadata.xml new file mode 100644 index 0000000000..16f5fcdd3a --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4479/repo/org/apache/maven/its/mng4479/dep/maven-metadata.xml @@ -0,0 +1,12 @@ + + + org.apache.maven.its.mng4479 + dep + 0.1 + + + 0.1 + + 20091206230357 + + diff --git a/its/core-it-suite/src/test/resources/mng-4479/settings-template.xml b/its/core-it-suite/src/test/resources/mng-4479/settings-template.xml new file mode 100644 index 0000000000..cde4215860 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4479/settings-template.xml @@ -0,0 +1,55 @@ + + + + + + + + maven-core-it-repo + + + maven-core-it + @baseurl@/repo + + ignore + + + false + + + + + + maven-core-it + @baseurl@/repo + + ignore + + + false + + + + + + + maven-core-it-repo + +