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 2024/12/04 11:00:15 UTC

(maven-javadoc-plugin) 01/01: Replace two deprecated methods

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

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

commit 0a122721ef348404240edffd316008e4ebe2bd0c
Author: Elliotte Rusty Harold <el...@ibiblio.org>
AuthorDate: Wed Dec 4 06:00:06 2024 -0500

    Replace two deprecated methods
---
 src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java b/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java
index df847ed5..d6d39fa8 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java
@@ -40,6 +40,7 @@ import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.nio.file.SimpleFileVisitor;
+import java.nio.file.StandardCopyOption;
 import java.nio.file.attribute.BasicFileAttributes;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -716,7 +717,7 @@ public class JavadocUtil {
             throw new NullPointerException("The url could not be null.");
         }
 
-        FileUtils.copyURLToFile(url, file);
+        Files.copy(url.openStream(), file.toPath(), StandardCopyOption.REPLACE_EXISTING);
     }
 
     /**
@@ -801,7 +802,7 @@ public class JavadocUtil {
         } else {
             request.setDebug(true);
         }
-        request.setGoals(goals);
+        request.addArgs(goals);
         if (properties != null) {
             request.setProperties(properties);
         }