diff --git a/its/core-integration-testing-plugins/maven-it-plugin-project-interpolation/pom.xml b/its/core-integration-testing-plugins/maven-it-plugin-project-interpolation/pom.xml new file mode 100644 index 0000000000..932cd68973 --- /dev/null +++ b/its/core-integration-testing-plugins/maven-it-plugin-project-interpolation/pom.xml @@ -0,0 +1,44 @@ + + + + + + + maven-it-plugins + org.apache.maven.its.plugins + 2.1-SNAPSHOT + + 4.0.0 + maven-it-plugin-project-interpolation + maven-plugin + Maven Integration Test Plugin :: Project Interpolation + 2001 + + + org.apache.maven + maven-plugin-api + 2.0 + + + + org.apache.maven.its + maven-integration-test-helper + ${project.version} + + + diff --git a/its/core-integration-testing-plugins/maven-it-plugin-project-interpolation/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java b/its/core-integration-testing-plugins/maven-it-plugin-project-interpolation/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java new file mode 100644 index 0000000000..a955d0fa86 --- /dev/null +++ b/its/core-integration-testing-plugins/maven-it-plugin-project-interpolation/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java @@ -0,0 +1,38 @@ +package org.apache.maven.plugin.coreit; + +/* + * Copyright 2001-2004 The Apache Software Foundation. + * + * Licensed 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.artifact.Artifact; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; + +/** + * @goal touch + * + * @phase process-sources + * + * @description Goal which cleans the build + */ +public class CoreItMojo + extends AbstractMojo +{ + public void execute() + throws MojoExecutionException + { + getLog().info( "Don't touch me!" ); + } +} diff --git a/its/core-integration-testing-plugins/pom.xml b/its/core-integration-testing-plugins/pom.xml index 2982e43aef..574f2b9ba5 100644 --- a/its/core-integration-testing-plugins/pom.xml +++ b/its/core-integration-testing-plugins/pom.xml @@ -19,6 +19,7 @@ maven-it-plugin-no-project maven-it-plugin-packaging maven-it-plugin-parameter-implementation + maven-it-plugin-project-interpolation maven-it-plugin-setter maven-it-plugin-touch maven-it-plugin-uses-properties diff --git a/its/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng2339BadProjectInterpolationTest.java b/its/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng2339BadProjectInterpolationTest.java new file mode 100644 index 0000000000..f137d9a925 --- /dev/null +++ b/its/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng2339BadProjectInterpolationTest.java @@ -0,0 +1,37 @@ +package org.apache.maven.integrationtests; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +import org.apache.maven.integrationtests.AbstractMavenIntegrationTestCase; +import org.apache.maven.it.Verifier; +import org.apache.maven.it.util.ResourceExtractor; + +public class MavenITmng2339BadProjectInterpolationTest + extends AbstractMavenIntegrationTestCase +{ + public MavenITmng2339BadProjectInterpolationTest() + throws org.apache.maven.artifact.versioning.InvalidVersionSpecificationException + { + super( "(2.0.8,)" ); // 2.0.9+ + } + + public void testitMNG2339() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2339-badProjectInterpolation" ); + + Verifier verifier; + + verifier = new Verifier( testDir.getAbsolutePath() ); + + List cliOptions = new ArrayList(); + cliOptions.add( "-Dversion=foo" ); + verifier.setCliOptions( cliOptions ); + verifier.executeGoal( "process-sources" ); + + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + } +} diff --git a/its/core-integration-tests/src/test/resources/mng-2339-badProjectInterpolation/pom.xml b/its/core-integration-tests/src/test/resources/mng-2339-badProjectInterpolation/pom.xml new file mode 100644 index 0000000000..984ba82c32 --- /dev/null +++ b/its/core-integration-tests/src/test/resources/mng-2339-badProjectInterpolation/pom.xml @@ -0,0 +1,22 @@ + + 4.0.0 + org.apache.maven.its.mng2339 + bad-project-interpolation + 1.0-SNAPSHOT + + + + org.apache.maven.its.plugins + maven-it-plugin-project-interpolation + 2.1-SNAPSHOT + + + + touch + + + + + + +