You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2014/02/08 20:59:32 UTC

[2/2] git commit: [MNG-5572] Warn for building plugins with extensions in a reactor

[MNG-5572] Warn for building plugins with extensions in a reactor


Project: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/commit/b5f7a802
Tree: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/tree/b5f7a802
Diff: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/diff/b5f7a802

Branch: refs/heads/master
Commit: b5f7a802fd507d10b560038690107b16cf00b756
Parents: bd1ea46
Author: Robert Scholte <rf...@codehaus.org>
Authored: Sat Feb 8 20:57:38 2014 +0100
Committer: Robert Scholte <rf...@codehaus.org>
Committed: Sat Feb 8 20:58:49 2014 +0100

----------------------------------------------------------------------
 .../apache/maven/it/IntegrationTestSuite.java   |  1 +
 .../apache/maven/it/MavenITBootstrapTest.java   |  2 +-
 ...venITmng5572ReactorPluginExtensionsTest.java | 68 ++++++++++++++++++++
 .../src/test/resources/bootstrap/pom.xml        |  5 ++
 .../plugin/pom.xml                              | 60 +++++++++++++++++
 .../mng-5572-reactor-plugin-extensions/pom.xml  | 32 +++++++++
 .../project/pom.xml                             | 42 ++++++++++++
 7 files changed, 209 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/b5f7a802/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java b/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
index aa47616..4b8ff07 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
@@ -105,6 +105,7 @@ public class IntegrationTestSuite
         // Tests that don't run stable and need to be fixed
         // -------------------------------------------------------------------------------------------------------------
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137        
+        suite.addTestSuite( MavenITmng5572ReactorPluginExtensionsTest.class  );
         suite.addTestSuite( MavenITmng5576CdFriendlyVersions.class );
         suite.addTestSuite( MavenITmng5530MojoExecutionScopeTest.class );
         //suite.addTestSuite( MavenITmng5208EventSpyParallelTest.class );

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/b5f7a802/core-it-suite/src/test/java/org/apache/maven/it/MavenITBootstrapTest.java
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITBootstrapTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITBootstrapTest.java
index ee0d12d..9b4c627 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITBootstrapTest.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITBootstrapTest.java
@@ -51,7 +51,7 @@ public class MavenITBootstrapTest
         verifier.setAutoclean( false );
         verifier.addCliOption( "--settings" );
         verifier.addCliOption( "settings.xml" );
-        verifier.executeGoal( "test-compile" );
+        verifier.executeGoal( "install" );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
     }

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/b5f7a802/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5572ReactorPluginExtensionsTest.java
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5572ReactorPluginExtensionsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5572ReactorPluginExtensionsTest.java
new file mode 100644
index 0000000..b8d7434
--- /dev/null
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5572ReactorPluginExtensionsTest.java
@@ -0,0 +1,68 @@
+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.util.ResourceExtractor;
+
+import java.io.File;
+
+/**
+ * This is a test set for <a href="http://jira.codehaus.org/browse/MNG-5572">MNG-5572</a>
+ * as a response to <a href="http://jira.codehaus.org/browse/MNG-1911">MNG-1911</a>
+ * 
+ * 
+ * @author rfscholte
+ */
+public class MavenITmng5572ReactorPluginExtensionsTest
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng5572ReactorPluginExtensionsTest()
+    {
+        super( "[3.2,)" );
+    }
+
+    /**
+     * Test that Maven warns when one reactor project contains a plugin, and another tries to use it with extensions 
+     */
+    public void testit()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5572-reactor-plugin-extensions" );
+
+        // plugin must be available in local repo, otherwise the project couldn't be built
+        Verifier setup = newVerifier( testDir.getAbsolutePath() );
+        setup.setAutoclean( true );
+        setup.addCliOption( "-f" );
+        setup.addCliOption( "plugin/pom.xml" );
+        setup.executeGoal( "install" );
+        setup.verifyErrorFreeLog();
+        setup.resetStreams();
+
+        Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+        verifier.setLogFileName( "log2.txt" );
+        verifier.setAutoclean( false );
+        verifier.executeGoal( "validate" );
+        verifier.verifyErrorFreeLog();
+        verifier.verifyTextInLog( "[WARNING] project uses org.apache.maven.its.mng5572:plugin as extensions, which is not possible within the same reactor build. This plugin was pulled from the local repository!" );
+        verifier.resetStreams();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/b5f7a802/core-it-suite/src/test/resources/bootstrap/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/bootstrap/pom.xml b/core-it-suite/src/test/resources/bootstrap/pom.xml
index eba3a6c..e0edb9a 100644
--- a/core-it-suite/src/test/resources/bootstrap/pom.xml
+++ b/core-it-suite/src/test/resources/bootstrap/pom.xml
@@ -59,6 +59,11 @@ under the License.
       </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <version>2.2</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-resources-plugin</artifactId>
         <version>2.2</version>
       </plugin>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/b5f7a802/core-it-suite/src/test/resources/mng-5572-reactor-plugin-extensions/plugin/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-5572-reactor-plugin-extensions/plugin/pom.xml b/core-it-suite/src/test/resources/mng-5572-reactor-plugin-extensions/plugin/pom.xml
new file mode 100644
index 0000000..b99e333
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5572-reactor-plugin-extensions/plugin/pom.xml
@@ -0,0 +1,60 @@
+<?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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  
+  <!-- no parent, must be standalone -->
+  
+  <groupId>org.apache.maven.its.mng5572</groupId>
+  <artifactId>plugin</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>maven-plugin</packaging>
+
+  <!-- NOTE: Use stub versions of the core plugins referenced by the build -->
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>0.1-stub-SNAPSHOT</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-plugin-plugin</artifactId>
+          <version>0.1-stub-SNAPSHOT</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-resources-plugin</artifactId>
+          <version>0.1-stub-SNAPSHOT</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-surefire-plugin</artifactId>
+          <version>0.1-stub-SNAPSHOT</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+    <plugins>
+      <plugin> <!-- force attaching file during 'mvn install'  -->
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <version>2.2</version>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/b5f7a802/core-it-suite/src/test/resources/mng-5572-reactor-plugin-extensions/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-5572-reactor-plugin-extensions/pom.xml b/core-it-suite/src/test/resources/mng-5572-reactor-plugin-extensions/pom.xml
new file mode 100644
index 0000000..aa692e2
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5572-reactor-plugin-extensions/pom.xml
@@ -0,0 +1,32 @@
+<?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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.its.mng5572</groupId>
+  <artifactId>parent</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+  <modules>
+    <module>plugin</module>
+    <module>project</module>
+  </modules>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/b5f7a802/core-it-suite/src/test/resources/mng-5572-reactor-plugin-extensions/project/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-5572-reactor-plugin-extensions/project/pom.xml b/core-it-suite/src/test/resources/mng-5572-reactor-plugin-extensions/project/pom.xml
new file mode 100644
index 0000000..d8f1648
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5572-reactor-plugin-extensions/project/pom.xml
@@ -0,0 +1,42 @@
+<?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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.maven.its.mng5572</groupId>
+    <artifactId>parent</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>project</artifactId>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.mng5572</groupId>
+        <artifactId>plugin</artifactId>
+        <version>1.0-SNAPSHOT</version>
+        <extensions>true</extensions>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file