You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jv...@apache.org on 2015/04/27 21:30:19 UTC

maven-integration-testing git commit: MNG-5805: Custom packaging types: configuring DefaultLifecycleMapping mojo executions

Repository: maven-integration-testing
Updated Branches:
  refs/heads/master 445dbb937 -> 63656ffd5


MNG-5805: Custom packaging types: configuring DefaultLifecycleMapping mojo executions

Signed-off-by: Jason van Zyl <ja...@tesla.io>


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

Branch: refs/heads/master
Commit: 63656ffd5cd9c5287715336a5f91baf27c8360f1
Parents: 445dbb9
Author: Anton Tanasenko <at...@gmail.com>
Authored: Mon Apr 20 00:50:37 2015 +0300
Committer: Jason van Zyl <ja...@tesla.io>
Committed: Mon Apr 27 15:13:54 2015 -0400

----------------------------------------------------------------------
 .../apache/maven/it/IntegrationTestSuite.java   |  1 +
 .../MavenITmng5805PkgTypeMojoConfiguration.java | 43 +++++++++++++++
 .../extension/pom.xml                           | 30 +++++++++++
 .../resources/META-INF/plexus/components.xml    | 53 +++++++++++++++++++
 .../plugin-dep/pom.xml                          | 30 +++++++++++
 .../apache/maven/its/mng5805/TestClass1.java    |  5 ++
 .../plugin/pom.xml                              | 55 ++++++++++++++++++++
 .../maven/its/mng5805/plugin/TestMojo.java      | 51 ++++++++++++++++++
 .../project/pom.xml                             | 40 ++++++++++++++
 9 files changed, 308 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/63656ffd/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 98e5752..662b30b 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( MavenITmng5805PkgTypeMojoConfiguration.class );
         suite.addTestSuite( MavenITmng5783PluginDependencyFiltering.class );
         suite.addTestSuite( MavenITmng5774ConfigurationProcessorsTest.class );
         suite.addTestSuite( MavenITmng5771CoreExtensionsTest.class );

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/63656ffd/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5805PkgTypeMojoConfiguration.java
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5805PkgTypeMojoConfiguration.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5805PkgTypeMojoConfiguration.java
new file mode 100644
index 0000000..b0dec8d
--- /dev/null
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5805PkgTypeMojoConfiguration.java
@@ -0,0 +1,43 @@
+package org.apache.maven.it;
+
+import java.io.File;
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+public class MavenITmng5805PkgTypeMojoConfiguration
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng5805PkgTypeMojoConfiguration()
+    {
+        super( "(3.3.2,)" );
+    }
+
+    public void testPkgTypeMojoConfiguration()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5805-pkg-type-mojo-configuration" );
+        
+        Verifier verifier;
+        
+        verifier = newVerifier( new File( testDir, "extension" ).getAbsolutePath() );
+        verifier.executeGoal( "install" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+        
+        verifier = newVerifier( new File( testDir, "plugin" ).getAbsolutePath() );
+        verifier.executeGoal( "install" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+        
+        verifier = newVerifier( new File( testDir, "plugin-dep" ).getAbsolutePath() );
+        verifier.executeGoal( "install" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+        
+        verifier = newVerifier( new File( testDir, "project" ).getAbsolutePath() );
+        verifier.executeGoal( "validate" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+    }
+}

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/63656ffd/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/extension/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/extension/pom.xml b/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/extension/pom.xml
new file mode 100644
index 0000000..d3bda34
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/extension/pom.xml
@@ -0,0 +1,30 @@
+<?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>mng-5805-pkg-type-mojo-configuration</groupId>
+  <artifactId>mng-5805-pkg-type-mojo-configuration-extension</artifactId>
+  <version>0.1</version>
+  <packaging>jar</packaging>
+</project>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/63656ffd/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/extension/src/main/resources/META-INF/plexus/components.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/extension/src/main/resources/META-INF/plexus/components.xml b/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/extension/src/main/resources/META-INF/plexus/components.xml
new file mode 100644
index 0000000..2bf810d
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/extension/src/main/resources/META-INF/plexus/components.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<component-set>
+  <components>
+  
+    <component>
+      <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
+      <role-hint>mng5805</role-hint>
+      <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
+      <configuration>
+        <lifecycles>
+          <lifecycle>
+            <id>default</id>
+            <phases>
+              <validate>
+                <mojos>
+                  <mojo>
+                    <goal>
+                      mng-5805-pkg-type-mojo-configuration:mng-5805-pkg-type-mojo-configuration-plugin:0.1:test
+                    </goal>
+                    <configuration>
+                      <className>org.apache.maven.its.mng5805.TestClass1</className>
+                    </configuration>
+                    <dependencies>
+                      <dependency>
+                        <groupId>org.apache.maven.its.mng5805</groupId>
+                        <artifactId>plugin-dep</artifactId>
+                        <version>0.1</version>
+                      </dependency>
+                    </dependencies>
+                  </mojo>
+                </mojos>
+              </validate>
+            </phases>
+          </lifecycle>
+        </lifecycles>
+      </configuration>
+    </component>
+    
+    <component>
+      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
+      <role-hint>mng5805</role-hint>
+      <implementation>
+        org.apache.maven.artifact.handler.DefaultArtifactHandler
+      </implementation>
+      <configuration>
+        <extension>zip</extension>
+        <type>mng5805</type>
+        <packaging>mng5805</packaging>
+      </configuration>
+    </component>
+    
+  </components>
+</component-set>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/63656ffd/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/plugin-dep/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/plugin-dep/pom.xml b/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/plugin-dep/pom.xml
new file mode 100644
index 0000000..b640125
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/plugin-dep/pom.xml
@@ -0,0 +1,30 @@
+<?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.mng5805</groupId>
+  <artifactId>plugin-dep</artifactId>
+  <version>0.1</version>
+
+</project>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/63656ffd/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/plugin-dep/src/main/java/org/apache/maven/its/mng5805/TestClass1.java
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/plugin-dep/src/main/java/org/apache/maven/its/mng5805/TestClass1.java b/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/plugin-dep/src/main/java/org/apache/maven/its/mng5805/TestClass1.java
new file mode 100644
index 0000000..e20a23c
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/plugin-dep/src/main/java/org/apache/maven/its/mng5805/TestClass1.java
@@ -0,0 +1,5 @@
+package org.apache.maven.its.mng5805;
+
+public class TestClass1 {
+
+}

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/63656ffd/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/plugin/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/plugin/pom.xml b/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/plugin/pom.xml
new file mode 100644
index 0000000..6a30131
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/plugin/pom.xml
@@ -0,0 +1,55 @@
+<?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>mng-5805-pkg-type-mojo-configuration</groupId>
+  <artifactId>mng-5805-pkg-type-mojo-configuration-plugin</artifactId>
+  <version>0.1</version>
+  <packaging>maven-plugin</packaging>
+
+  <properties>
+    <maven-version>3.3.1</maven-version>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>${maven-version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-model</artifactId>
+      <version>${maven-version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-core</artifactId>
+      <version>${maven-version}</version>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/63656ffd/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/plugin/src/main/java/org/apache/maven/its/mng5805/plugin/TestMojo.java
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/plugin/src/main/java/org/apache/maven/its/mng5805/plugin/TestMojo.java b/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/plugin/src/main/java/org/apache/maven/its/mng5805/plugin/TestMojo.java
new file mode 100644
index 0000000..b4e4e71
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/plugin/src/main/java/org/apache/maven/its/mng5805/plugin/TestMojo.java
@@ -0,0 +1,51 @@
+package org.apache.maven.its.mng5805.plugin;
+
+/*
+ * 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.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+
+/**
+ * @goal test
+ */
+public class TestMojo
+    extends AbstractMojo
+{
+    /**
+     * @parameter default-value="org.apache.maven.its.mng5805.DoesNotExist"
+     */
+    private String className;
+    
+    public void execute()
+        throws MojoExecutionException
+    {
+        
+        getLog().info( "CLASS_NAME=" + className );
+        
+        try
+        {
+            Class.forName( className );
+        }
+        catch (ClassNotFoundException e)
+        {
+            throw new MojoExecutionException( e.getMessage(), e );
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/63656ffd/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/project/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/project/pom.xml b/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/project/pom.xml
new file mode 100644
index 0000000..bcc9131
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration/project/pom.xml
@@ -0,0 +1,40 @@
+<?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>mng-5805-pkg-type-mojo-configuration</groupId>
+  <artifactId>mng-5805-pkg-type-mojo-configuration-project</artifactId>
+  <version>0.1</version>
+  <packaging>mng5805</packaging>
+  
+  <build>
+    <extensions>
+      <extension>
+        <groupId>mng-5805-pkg-type-mojo-configuration</groupId>
+        <artifactId>mng-5805-pkg-type-mojo-configuration-extension</artifactId>
+        <version>0.1</version>
+      </extension>
+    </extensions>
+  </build>
+</project>