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 9495ade425..3ecb4b07b7 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 @@ -400,6 +400,7 @@ public class IntegrationTestSuite suite.addTestSuite( MavenITmng2174PluginDepsManagedByParentProfileTest.class ); suite.addTestSuite( MavenITmng2140ReactorAwareDepResolutionWhenForkTest.class ); suite.addTestSuite( MavenITmng2136ActiveByDefaultProfileTest.class ); + suite.addTestSuite( MavenITmng2135PluginBuildInReactorTest.class ); suite.addTestSuite( MavenITmng2130ParentLookupFromReactorCacheTest.class ); suite.addTestSuite( MavenITmng2124PomInterpolationWithParentValuesTest.class ); suite.addTestSuite( MavenITmng2123VersionRangeDependencyTest.class ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2135PluginBuildInReactorTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2135PluginBuildInReactorTest.java new file mode 100644 index 0000000000..ea82eb2020 --- /dev/null +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2135PluginBuildInReactorTest.java @@ -0,0 +1,61 @@ +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 MNG-2135. + * + * @author Benjamin Bentmann + */ +public class MavenITmng2135PluginBuildInReactorTest + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng2135PluginBuildInReactorTest() + { + super( "[3.0-alpha-3,)" ); + } + + /** + * Test that the reactor can handle builds where one module provides a Maven plugin that another module uses. + */ + public void testit() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2135" ); + + Verifier verifier = new Verifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "plugin/target" ); + verifier.deleteDirectory( "project/target" ); + verifier.deleteArtifacts( "org.apache.maven.its.mng2135" ); + verifier.executeGoal( "package" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + verifier.assertFilePresent( "project/target/touch.txt" ); + } + +} diff --git a/its/core-it-suite/src/test/resources/mng-2135/plugin/pom.xml b/its/core-it-suite/src/test/resources/mng-2135/plugin/pom.xml new file mode 100644 index 0000000000..a7f536799b --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-2135/plugin/pom.xml @@ -0,0 +1,46 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng2135 + plugin + 0.1 + maven-plugin + + Maven Integration Test :: MNG-2135 :: Plugin + + Test that the reactor can handle builds where one module provides a Maven plugin that another module uses. + + + + true + + + + + org.apache.maven + maven-plugin-api + 2.0 + + + diff --git a/its/core-it-suite/src/test/resources/mng-2135/plugin/src/main/java/coreit/ItMojo.java b/its/core-it-suite/src/test/resources/mng-2135/plugin/src/main/java/coreit/ItMojo.java new file mode 100644 index 0000000000..96de5ca4db --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-2135/plugin/src/main/java/coreit/ItMojo.java @@ -0,0 +1,52 @@ +package coreit; + +/* + * 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 java.io.*; + +import org.apache.maven.plugin.*; + +/** + * @goal it + */ +public class ItMojo + extends AbstractMojo +{ + + /** + * @parameter default-value="${project.build.directory}/touch.txt" + */ + private File outputFile; + + public void execute() + throws MojoExecutionException + { + try + { + outputFile.getParentFile().mkdirs(); + outputFile.createNewFile(); + } + catch ( IOException e ) + { + throw new MojoExecutionException( "Failed to create touch file: " + e.getMessage(), e ); + } + } + +} diff --git a/its/core-it-suite/src/test/resources/mng-2135/pom.xml b/its/core-it-suite/src/test/resources/mng-2135/pom.xml new file mode 100644 index 0000000000..8d020446b0 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-2135/pom.xml @@ -0,0 +1,40 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng2135 + test + 0.1 + pom + + Maven Integration Test :: MNG-2135 + + Test that the reactor can handle builds where one module provides a Maven plugin that another module uses. + + + + + project + plugin + + diff --git a/its/core-it-suite/src/test/resources/mng-2135/project/pom.xml b/its/core-it-suite/src/test/resources/mng-2135/project/pom.xml new file mode 100644 index 0000000000..96a5d98d92 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-2135/project/pom.xml @@ -0,0 +1,53 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng2135 + project + 0.1 + pom + + Maven Integration Test :: MNG-2135 :: Project + + Test that the reactor can handle builds where one module provides a Maven plugin that another module uses. + + + + + + org.apache.maven.its.mng2135 + plugin + 0.1 + + + test + validate + + it + + + + + + +