maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject svn commit: r480829 - in /maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency: fromConfiguration/ utils/filters/
Date Thu, 30 Nov 2006 04:17:54 GMT
Author: brianf
Date: Wed Nov 29 20:17:53 2006
New Revision: 480829

URL: http://svn.apache.org/viewvc?view=rev&rev=480829
Log:
unpack refactor

Modified:
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/ArtifactItemFilter.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/DestFileFilter.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/MarkerFileFilter.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/ResolveFileFilter.java

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java?view=diff&rev=480829&r1=480828&r2=480829
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java
(original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java
Wed Nov 29 20:17:53 2006
@@ -111,7 +111,8 @@
 
     ArtifactItemFilter getMarkedArtifactFilter( ArtifactItem item )
     {
-        // TODO Auto-generated method stub
-        return null;
+        MarkerHandler handler = new DefaultFileMarkerHandler( item.getArtifact(), this.markersDirectory
);
+        
+        return new MarkerFileFilter(this.overWriteReleases,this.overWriteSnapshots,this.overWriteIfNewer,handler);
     }
 }

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/ArtifactItemFilter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/ArtifactItemFilter.java?view=diff&rev=480829&r1=480828&r2=480829
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/ArtifactItemFilter.java
(original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/ArtifactItemFilter.java
Wed Nov 29 20:17:53 2006
@@ -1,4 +1,4 @@
- /*
+/*
  * 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
@@ -21,14 +21,16 @@
  */
 package org.apache.maven.plugin.dependency.utils.filters;
 
+import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.dependency.fromConfiguration.ArtifactItem;
 
 /**
  * @author brianf
- *
+ * 
  */
 public interface ArtifactItemFilter
 {
 
-    public boolean okToProcess ( ArtifactItem item);
+    public boolean okToProcess( ArtifactItem item )
+        throws MojoExecutionException;
 }

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/DestFileFilter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/DestFileFilter.java?view=diff&rev=480829&r1=480828&r2=480829
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/DestFileFilter.java
(original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/DestFileFilter.java
Wed Nov 29 20:17:53 2006
@@ -224,7 +224,7 @@
         this.useSubDirectoryPerType = useSubDirectoryPerType;
     }
 
-    public boolean okToProcess( ArtifactItem item )
+    public boolean okToProcess( ArtifactItem item ) throws MojoExecutionException
     {
         boolean overWrite = false;
         boolean result = false;

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/MarkerFileFilter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/MarkerFileFilter.java?view=diff&rev=480829&r1=480828&r2=480829
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/MarkerFileFilter.java
(original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/MarkerFileFilter.java
Wed Nov 29 20:17:53 2006
@@ -28,6 +28,7 @@
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.dependency.fromConfiguration.ArtifactItem;
 import org.apache.maven.plugin.dependency.utils.markers.MarkerHandler;
 import org.apache.maven.plugin.logging.Log;
 
@@ -37,6 +38,7 @@
  */
 public class MarkerFileFilter
     extends AbstractArtifactsFilter
+    implements ArtifactItemFilter
 {
 
     boolean overWriteReleases;
@@ -72,7 +74,7 @@
         while ( iter.hasNext() )
         {
             Artifact artifact = (Artifact) iter.next();
-            if ( doOverwrite( artifact ) )
+            if ( okToProcess( new ArtifactItem( artifact ) ) )
             {
                 result.add( artifact );
             }
@@ -80,9 +82,10 @@
         return result;
     }
 
-    protected boolean doOverwrite( Artifact artifact )
+    public boolean okToProcess( ArtifactItem item )
         throws MojoExecutionException
     {
+        Artifact artifact = item.getArtifact();
         boolean overWrite = false;
         boolean result = false;
         if ( ( artifact.isSnapshot() && this.overWriteSnapshots )

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/ResolveFileFilter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/ResolveFileFilter.java?view=diff&rev=480829&r1=480828&r2=480829
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/ResolveFileFilter.java
(original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/ResolveFileFilter.java
Wed Nov 29 20:17:53 2006
@@ -24,6 +24,7 @@
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.dependency.fromConfiguration.ArtifactItem;
 import org.apache.maven.plugin.dependency.utils.markers.MarkerHandler;
 
 /**
@@ -39,10 +40,10 @@
         super( true, true, true, handler );
     }
 
-    protected boolean doOverwrite( Artifact artifact )
-        throws MojoExecutionException
+    public boolean okToProcess( ArtifactItem item )
+    throws MojoExecutionException
     {        
-        handler.setArtifact( artifact );
+        handler.setArtifact( item.getArtifact() );
         return ( !handler.isMarkerSet() );
     }
 }



Mime
View raw message