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/03 22:11:31 UTC

[maven-dependency-plugin] branch ex created (now 0c8d853)

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

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


      at 0c8d853  remove unused code

This branch includes the following new commits:

     new 0c8d853  remove unused code

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven-dependency-plugin] 01/01: remove unused code

Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 0c8d853ff68421906952eb4b46cc40e8e4b6da0c
Author: Elliotte Rusty Harold <el...@google.com>
AuthorDate: Tue Mar 3 17:11:18 2020 -0500

    remove unused code
---
 .../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 22a0dd3..c6f7fa9 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