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 19:13:43 UTC

(maven-javadoc-plugin) branch master updated: Replace two deprecated methods (#347)

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-javadoc-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new 6f432fbe Replace two deprecated methods (#347)
6f432fbe is described below

commit 6f432fbe57c2733fc2f7c7fa6c31105945dee84e
Author: Elliotte Rusty Harold <el...@users.noreply.github.com>
AuthorDate: Wed Dec 4 19:13:38 2024 +0000

    Replace two deprecated methods (#347)
---
 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);
         }