You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by el...@apache.org on 2020/03/08 11:57:11 UTC

[maven-dependency-plugin] branch master updated: remove unused code (#34)

This is an automated email from the ASF dual-hosted git repository.

elharo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-dependency-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new 8d21744  remove unused code (#34)
8d21744 is described below

commit 8d2174493823fa3f221df600aa0e5f29041dff41
Author: Elliotte Rusty Harold <el...@users.noreply.github.com>
AuthorDate: Sun Mar 8 07:57:03 2020 -0400

    remove unused code (#34)
---
 .../maven/plugins/dependency/PurgeLocalRepositoryMojo.java    | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/dependency/PurgeLocalRepositoryMojo.java b/src/main/java/org/apache/maven/plugins/dependency/PurgeLocalRepositoryMojo.java
index fdc16bc..2249a08 100644
--- a/src/main/java/org/apache/maven/plugins/dependency/PurgeLocalRepositoryMojo.java
+++ b/src/main/java/org/apache/maven/plugins/dependency/PurgeLocalRepositoryMojo.java
@@ -32,7 +32,6 @@ import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.ArtifactUtils;
 import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
 import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
 import org.apache.maven.artifact.resolver.ArtifactResolutionException;
 import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
 import org.apache.maven.execution.MavenSession;
@@ -388,12 +387,11 @@ public class PurgeLocalRepositoryMojo
         if ( reResolve )
         {
             getLog().info( "Re-resolving dependencies" );
-            ArtifactFilter artifactFilter = dependencyFilter.transform( new ArtifactIncludeFilterTransformer() );
             try
             {
-                reResolveArtifacts( theProject, resolvedArtifactsToPurge, artifactFilter );
+                reResolveArtifacts( theProject, resolvedArtifactsToPurge );
             }
-            catch ( ArtifactResolutionException | ArtifactNotFoundException e )
+            catch ( ArtifactResolutionException e )
             {
                 String failureMessage = "Failed to refresh project dependencies for: " + theProject.getId();
                 throw new MojoFailureException( failureMessage, e );
@@ -625,7 +623,6 @@ public class PurgeLocalRepositoryMojo
     }
 
     private void purgeArtifacts( MavenProject theProject, Set<Artifact> artifacts )
-        throws MojoFailureException
     {
         MessageBuilder messageBuilder = MessageUtils.buffer();
 
@@ -668,8 +665,8 @@ public class PurgeLocalRepositoryMojo
         }
     }
 
-    private void reResolveArtifacts( MavenProject theProject, Set<Artifact> artifacts, ArtifactFilter filter )
-        throws ArtifactResolutionException, ArtifactNotFoundException
+    private void reResolveArtifacts( MavenProject theProject, Set<Artifact> artifacts )
+        throws ArtifactResolutionException
     {
         // Always need to re-resolve the poms in case they were purged along with the artifact
         // because Maven 2 will not automatically re-resolve them when resolving the artifact