Author: jvanzyl
Date: Sat Oct 21 13:50:36 2006
New Revision: 466560

URL: http://svn.apache.org/viewvc?view=rev&rev=466560
Log:
IT plugin to testing packaging

Added:
    maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/
    maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/pom.xml   
(with props)
    maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/src/
    maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/src/main/
    
maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/src/main/java/
    
maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/src/main/java/org/
    
maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/src/main/java/org/apache/
    
maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/src/main/java/org/apache/maven/
    
maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/src/main/java/org/apache/maven/plugin/
    
maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/src/main/java/org/apache/maven/plugin/coreit/
    
maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/src/main/java/org/apache/maven/plugin/coreit/PackagingMojo.java
   (with props)
    
maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/src/main/resources/
    
maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/src/main/resources/META-INF/
    
maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/src/main/resources/META-INF/plexus/
    
maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/src/main/resources/META-INF/plexus/components.xml
   (with props)

Added: maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/pom.xml?view=auto&rev=466560
==============================================================================
--- maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/pom.xml 
(added)
+++ maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/pom.xml 
Sat Oct 21 13:50:36 2006
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  ~ Copyright 2005-2006 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.
+  -->
+
+<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/maven-v4_0_0.xsd";>
+  <parent>
+    <artifactId>maven-plugins</artifactId>
+    <groupId>org.apache.maven.plugins</groupId>
+    <version>2-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>maven-core-it-plugin</artifactId>
+  <packaging>maven-plugin</packaging>
+  <name>Maven Core Integration Test Plugin</name>
+  <version>1.1-SNAPSHOT</version>
+  <inceptionYear>2001</inceptionYear>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>2.0</version>
+    </dependency>
+  </dependencies>
+</project>

Propchange: 
maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: 
maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/src/main/java/org/apache/maven/plugin/coreit/PackagingMojo.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/src/main/java/org/apache/maven/plugin/coreit/PackagingMojo.java?view=auto&rev=466560
==============================================================================
--- 
maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/src/main/java/org/apache/maven/plugin/coreit/PackagingMojo.java
 (added)
+++ 
maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/src/main/java/org/apache/maven/plugin/coreit/PackagingMojo.java
 Sat Oct 21 13:50:36 2006
@@ -0,0 +1,81 @@
+package org.apache.maven.plugin.coreit;
+
+/*
+ * Copyright 2001-2005 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.archiver.MavenArchiver;
+import org.apache.maven.archiver.MavenArchiveConfiguration;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.archiver.jar.JarArchiver;
+
+import java.io.File;
+
+/**
+ * @author <a href="[EMAIL PROTECTED]">Brett Porter</a>
+ * @version $Id$
+ * @goal package
+ */
+public class PackagingMojo
+    extends AbstractMojo
+{
+    
+    /**
+     * @parameter expression="${project}"
+     * @required
+     */
+    private MavenProject project;
+
+    /**
+     * @parameter expression="${project.build.finalName}"
+     * @required
+     */
+    private String finalName;
+
+    /**
+     * @parameter expression="${project.build.directory}"
+     * @required
+     * @readonly
+     */
+    private String outputDirectory;
+
+    public void execute()
+        throws MojoExecutionException
+    {
+        File jarFile = new File( outputDirectory, finalName + "-it.jar" );
+
+        MavenArchiver archiver = new MavenArchiver();
+
+        archiver.setArchiver( new JarArchiver() );
+
+        archiver.setOutputFile( jarFile );
+
+        try
+        {
+            archiver.createArchive( project, new MavenArchiveConfiguration() );
+        }
+        catch ( Exception e )
+        {
+            // TODO: improve error handling
+            throw new MojoExecutionException( "Error assembling JAR", e );
+        }
+        
+        project.getArtifact().setFile( jarFile );
+    }
+
+}
+                    

Propchange: 
maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/src/main/java/org/apache/maven/plugin/coreit/PackagingMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/src/main/java/org/apache/maven/plugin/coreit/PackagingMojo.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: 
maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/src/main/resources/META-INF/plexus/components.xml
URL: 
http://svn.apache.org/viewvc/maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/src/main/resources/META-INF/plexus/components.xml?view=auto&rev=466560
==============================================================================
--- 
maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/src/main/resources/META-INF/plexus/components.xml
 (added)
+++ 
maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/src/main/resources/META-INF/plexus/components.xml
 Sat Oct 21 13:50:36 2006
@@ -0,0 +1,27 @@
+<component-set>
+  <components>
+    <component>
+      <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
+      <role-hint>coreit-packaging</role-hint>
+      
<implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
+      <configuration>
+        <phases>
+          
<package>org.apache.maven.plugins:maven-core-it-plugin:package</package>
+          
<install>org.apache.maven.plugins:maven-install-plugin:install</install>
+          <deploy>org.apache.maven.plugins:maven-deploy-plugin:deploy</deploy>
+        </phases>
+      </configuration>
+    </component>
+    <component>
+      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
+      <role-hint>coreit-artifact</role-hint>
+      
<implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
+      <configuration>
+        <type>coreit-artifact</type>
+        <extension>jar</extension>
+        <packaging>coreit-packaging</packaging>
+        <classifier>it</classifier>
+      </configuration>
+    </component>
+  </components>
+</component-set>

Propchange: 
maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/src/main/resources/META-INF/plexus/components.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/sandbox/maven-it/maven-it-plugins/maven-it-plugin-packaging/src/main/resources/META-INF/plexus/components.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"


Reply via email to