You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sc...@apache.org on 2015/12/20 19:37:52 UTC

maven-integration-testing git commit: [MNG-5359] Declared execution in PluginMgmt gets bound to lifecycle (regression)

Repository: maven-integration-testing
Updated Branches:
  refs/heads/master ed5ffbe5a -> ee6c80a2b


[MNG-5359] Declared execution in PluginMgmt gets bound to lifecycle (regression)

o Updated to add integration test.


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/ee6c80a2
Tree: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/tree/ee6c80a2
Diff: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/diff/ee6c80a2

Branch: refs/heads/master
Commit: ee6c80a2bc8cb9d49b2e5390b66218ccb30ea745
Parents: ed5ffbe
Author: Christian Schulte <sc...@apache.org>
Authored: Sun Dec 20 19:34:40 2015 +0100
Committer: Christian Schulte <sc...@apache.org>
Committed: Sun Dec 20 19:34:40 2015 +0100

----------------------------------------------------------------------
 .../apache/maven/it/IntegrationTestSuite.java   |  1 +
 ...ginExecutionDeclarationInPluginMgmtTest.java | 58 +++++++++++++++
 .../src/test/resources/mng-5359/pom.xml         | 74 ++++++++++++++++++++
 .../java/org/apache/maven/its/mng5359/App.java  | 13 ++++
 4 files changed, 146 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/ee6c80a2/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 48051c9..bd1f77b 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
@@ -106,6 +106,7 @@ public class IntegrationTestSuite
         // -------------------------------------------------------------------------------------------------------------
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
 
+        suite.addTestSuite( MavenITmng5359CleanPluginExecutionDeclarationInPluginMgmtTest.class );
         suite.addTestSuite( MavenITmng5898BuildMultimoduleWithEARFailsToResolveWARTest.class );
         suite.addTestSuite( MavenITmng5840ParentVersionRanges.class );
         suite.addTestSuite( MavenITmng5840RelativePathReactorMatching.class );

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/ee6c80a2/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5359CleanPluginExecutionDeclarationInPluginMgmtTest.java
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5359CleanPluginExecutionDeclarationInPluginMgmtTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5359CleanPluginExecutionDeclarationInPluginMgmtTest.java
new file mode 100644
index 0000000..ef011e6
--- /dev/null
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5359CleanPluginExecutionDeclarationInPluginMgmtTest.java
@@ -0,0 +1,58 @@
+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-5359">MNG-5359</a>.
+ *
+ * @author Anders Hammar
+ */
+public class MavenITmng5359CleanPluginExecutionDeclarationInPluginMgmtTest
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng5359CleanPluginExecutionDeclarationInPluginMgmtTest()
+    {
+        // Might work with versions before 2.0.11, but not verified
+        super( "[2.0.11,3.0-alpha-1),(3.0.4,),[3.4,)" );
+    }
+
+    public void testit()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5359" );
+
+        Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+
+        verifier.setAutoclean( false );
+        verifier.deleteDirectory( "target" );
+        verifier.deleteArtifacts( "org.apache.maven.its.mng5359" );
+
+        verifier.executeGoal( "install" ); // will fail if clean plugin is executed
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+        
+        verifier.assertArtifactPresent( "org.apache.maven.its.mng5359", "test", "0.1-SNAPSHOT", "jar" );
+    }
+}

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/ee6c80a2/core-it-suite/src/test/resources/mng-5359/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-5359/pom.xml b/core-it-suite/src/test/resources/mng-5359/pom.xml
new file mode 100644
index 0000000..8b13d9d
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5359/pom.xml
@@ -0,0 +1,74 @@
+<?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.mng5359</groupId>
+  <artifactId>test</artifactId>
+  <version>0.1-SNAPSHOT</version>
+  <packaging>jar</packaging>
+
+  <name>Maven Integration Test :: MNG-5359</name>
+  <description>
+    Verifies that an execution of maven-clean-plugin declared in pluginManagement doesn't make it bound to the build lifecycle.
+  </description>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-clean-plugin</artifactId>
+          <version>2.5</version>
+          <executions>
+            <execution>
+              <id>auto-clean</id>
+              <phase>package</phase>
+              <goals>
+                <goal>clean</goal>
+              </goals>
+            </execution>
+          </executions>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>2.5.1</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-install-plugin</artifactId>
+          <version>2.4</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-jar-plugin</artifactId>
+          <version>2.4</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+</project>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/ee6c80a2/core-it-suite/src/test/resources/mng-5359/src/main/java/org/apache/maven/its/mng5359/App.java
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-5359/src/main/java/org/apache/maven/its/mng5359/App.java b/core-it-suite/src/test/resources/mng-5359/src/main/java/org/apache/maven/its/mng5359/App.java
new file mode 100644
index 0000000..2f61c7d
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5359/src/main/java/org/apache/maven/its/mng5359/App.java
@@ -0,0 +1,13 @@
+package org.apache.maven.its.mng5359;
+
+/**
+ * Hello world!
+ *
+ */
+public class App 
+{
+    public static void main( String[] args )
+    {
+        System.out.println( "Hello World!" );
+    }
+}