You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2009/01/13 22:44:14 UTC

svn commit: r734246 - in /maven/core-integration-testing/trunk: core-it-suite/src/test/resources/mng-3680/ core-it-support/core-it-plugins/maven-it-plugin-packaging/ core-it-support/core-it-plugins/maven-it-plugin-packaging/src/main/java/org/apache/mav...

Author: bentmann
Date: Tue Jan 13 13:44:07 2009
New Revision: 734246

URL: http://svn.apache.org/viewvc?rev=734246&view=rev
Log:
o Decoupled maven-it-plugin-packaging from APIs that are irrelevant for its purpose

Modified:
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3680/pom.xml
    maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-packaging/pom.xml
    maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-packaging/src/main/java/org/apache/maven/plugin/coreit/PackagingMojo.java
    maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-packaging/src/main/resources/META-INF/plexus/components.xml

Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3680/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3680/pom.xml?rev=734246&r1=734245&r2=734246&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3680/pom.xml (original)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3680/pom.xml Tue Jan 13 13:44:07 2009
@@ -27,7 +27,7 @@
 
   <dependencies>
     <dependency>
-      <!-- This has a broken POM, yet it's dependencies should contribute to this build -->
+      <!-- This has a broken POM, yet its dependencies should contribute to this build -->
       <groupId>org.apache.maven.its.mng3680</groupId>
       <artifactId>direct</artifactId>
       <version>0.1</version>

Modified: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-packaging/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-packaging/pom.xml?rev=734246&r1=734245&r2=734246&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-packaging/pom.xml (original)
+++ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-packaging/pom.xml Tue Jan 13 13:44:07 2009
@@ -32,28 +32,20 @@
   <packaging>maven-plugin</packaging>
 
   <name>Maven Integration Test Plugin :: Packaging</name>
+  <description>
+    A test plugin that defines a custom aritfact handler ("it-artifact") and a new packaging type ("it-packaging").
+  </description>
   <inceptionYear>2006</inceptionYear>
 
+  <properties>
+    <maven.test.skip>true</maven.test.skip>
+  </properties>
+
   <dependencies>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-plugin-api</artifactId>
       <version>2.0</version>
     </dependency>
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-project</artifactId>
-      <version>2.0</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-artifact</artifactId>
-      <version>2.0</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-archiver</artifactId>
-      <version>2.0</version>
-    </dependency>
   </dependencies>
 </project>

Modified: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-packaging/src/main/java/org/apache/maven/plugin/coreit/PackagingMojo.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-packaging/src/main/java/org/apache/maven/plugin/coreit/PackagingMojo.java?rev=734246&r1=734245&r2=734246&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-packaging/src/main/java/org/apache/maven/plugin/coreit/PackagingMojo.java (original)
+++ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-packaging/src/main/java/org/apache/maven/plugin/coreit/PackagingMojo.java Tue Jan 13 13:44:07 2009
@@ -19,16 +19,15 @@
  * 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;
+import java.io.IOException;
 
 /**
+ * Creates an empty file to prove this goal was executed.
+ * 
  * @author <a href="brett@apache.org">Brett Porter</a>
  * @version $Id$
  * @goal package
@@ -36,12 +35,6 @@
 public class PackagingMojo
     extends AbstractMojo
 {
-    
-    /**
-     * @parameter expression="${project}"
-     * @required
-     */
-    private MavenProject project;
 
     /**
      * @parameter expression="${project.build.finalName}"
@@ -54,31 +47,29 @@
      * @required
      * @readonly
      */
-    private String outputDirectory;
+    private File 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 );
+        getLog().info( "[MAVEN-CORE-IT-LOG] Creating artifact file: " + jarFile );
 
         try
         {
-            archiver.createArchive( project, new MavenArchiveConfiguration() );
+            jarFile.getParentFile().mkdirs();
+            jarFile.createNewFile();
         }
-        catch ( Exception e )
+        catch ( IOException e )
         {
-            // TODO: improve error handling
             throw new MojoExecutionException( "Error assembling JAR", e );
         }
-        
-        project.getArtifact().setFile( jarFile );
+
+        /*
+         * NOTE: Normal packaging plugins would set the main artifact's file path now but that's beyond the purpose of
+         * this test plugin. Hence there's no need to introduce further coupling with the Maven Artifact API.
+         */
     }
 
 }
-                    

Modified: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-packaging/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-packaging/src/main/resources/META-INF/plexus/components.xml?rev=734246&r1=734245&r2=734246&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-packaging/src/main/resources/META-INF/plexus/components.xml (original)
+++ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-packaging/src/main/resources/META-INF/plexus/components.xml Tue Jan 13 13:44:07 2009
@@ -6,9 +6,8 @@
       <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
       <configuration>
         <phases>
+          <!-- NOTE: This is intentionally a very minimalistic lifecycle -->
           <package>org.apache.maven.its.plugins:maven-it-plugin-packaging: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>