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

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

commit cc78e15eac528c13808feffb4884fca17e5a9260
Author: Elliotte Rusty Harold <elh...@ibiblio.org>
AuthorDate: Wed Nov 13 07:04:39 2024 -0500

    Replace deprecated ArtifactFactory interface
---
 .../dependency/fromDependencies/TestCopyDependenciesMojo2.java       | 4 +++-
 .../dependency/utils/translators/TestClassifierTypeTranslator.java   | 5 +----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git 
a/src/test/java/org/apache/maven/plugins/dependency/fromDependencies/TestCopyDependenciesMojo2.java
 
b/src/test/java/org/apache/maven/plugins/dependency/fromDependencies/TestCopyDependenciesMojo2.java
index f3a1f8b4..9ce4a8a7 100644
--- 
a/src/test/java/org/apache/maven/plugins/dependency/fromDependencies/TestCopyDependenciesMojo2.java
+++ 
b/src/test/java/org/apache/maven/plugins/dependency/fromDependencies/TestCopyDependenciesMojo2.java
@@ -29,6 +29,7 @@ import java.util.Set;
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.factory.DefaultArtifactFactory;
 import org.apache.maven.artifact.metadata.ArtifactMetadata;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
@@ -53,6 +54,7 @@ public class TestCopyDependenciesMojo2 extends 
AbstractDependencyMojoTestCase {
 
     private CopyDependenciesMojo mojo;
 
+    @Override
     protected void setUp() throws Exception {
         // required for mojo lookups to work
         super.setUp("copy-dependencies", true);
@@ -242,7 +244,7 @@ public class TestCopyDependenciesMojo2 extends 
AbstractDependencyMojoTestCase {
         mojo.useRepositoryLayout = true;
         mojo.execute();
 
-        ArtifactFactory artifactFactory = lookup(ArtifactFactory.class);
+        DefaultArtifactFactory artifactFactory = new DefaultArtifactFactory();
 
         File outputDirectory = mojo.outputDirectory;
         ArtifactRepository targetRepository = new MavenArtifactRepository(
diff --git 
a/src/test/java/org/apache/maven/plugins/dependency/utils/translators/TestClassifierTypeTranslator.java
 
b/src/test/java/org/apache/maven/plugins/dependency/utils/translators/TestClassifierTypeTranslator.java
index 93fd632c..89193594 100644
--- 
a/src/test/java/org/apache/maven/plugins/dependency/utils/translators/TestClassifierTypeTranslator.java
+++ 
b/src/test/java/org/apache/maven/plugins/dependency/utils/translators/TestClassifierTypeTranslator.java
@@ -24,7 +24,6 @@ import java.util.Iterator;
 import java.util.Set;
 
 import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.factory.ArtifactFactory;
 import org.apache.maven.artifact.factory.DefaultArtifactFactory;
 import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
 import org.apache.maven.artifact.handler.manager.DefaultArtifactHandlerManager;
@@ -44,8 +43,6 @@ import 
org.apache.maven.plugins.dependency.testUtils.DependencyArtifactStubFacto
 public class TestClassifierTypeTranslator extends 
AbstractDependencyMojoTestCase {
     Set<Artifact> artifacts = new HashSet<>();
 
-    ArtifactFactory artifactFactory;
-
     ArtifactRepository artifactRepository;
 
     Log log = new SilentLog();
@@ -59,7 +56,7 @@ public class TestClassifierTypeTranslator extends 
AbstractDependencyMojoTestCase
         artifactHandlerManager = new DefaultArtifactHandlerManager();
         this.setVariableValueToObject(artifactHandlerManager, 
"artifactHandlers", new HashMap<>());
 
-        artifactFactory = new DefaultArtifactFactory();
+        DefaultArtifactFactory artifactFactory = new DefaultArtifactFactory();
         this.setVariableValueToObject(artifactFactory, 
"artifactHandlerManager", artifactHandlerManager);
 
         artifactRepository = new StubArtifactRepository(null);

Reply via email to