You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2025/04/21 23:46:57 UTC

(maven-acr-plugin) branch cleanu1 created (now 276417e)

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

slachiewicz pushed a change to branch cleanu1
in repository https://gitbox.apache.org/repos/asf/maven-acr-plugin.git


      at 276417e  Cleanup deprecations

This branch includes the following new commits:

     new 276417e  Cleanup deprecations

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-acr-plugin) 01/01: Cleanup deprecations

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

slachiewicz pushed a commit to branch cleanu1
in repository https://gitbox.apache.org/repos/asf/maven-acr-plugin.git

commit 276417e9ad0bc2d7878f339b8501d22f9996947b
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Tue Apr 22 01:32:46 2025 +0200

    Cleanup deprecations
---
 src/main/java/org/apache/maven/plugins/acr/AcrMojo.java | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/acr/AcrMojo.java b/src/main/java/org/apache/maven/plugins/acr/AcrMojo.java
index e3fc0cf..e7dede3 100644
--- a/src/main/java/org/apache/maven/plugins/acr/AcrMojo.java
+++ b/src/main/java/org/apache/maven/plugins/acr/AcrMojo.java
@@ -23,6 +23,7 @@ import javax.inject.Named;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Path;
 import java.util.List;
 
 import org.apache.commons.io.input.XmlStreamReader;
@@ -187,7 +188,7 @@ public class AcrMojo extends AbstractMojo {
         archiver.setOutputFile(jarFile);
 
         // configure for Reproducible Builds based on outputTimestamp value
-        archiver.configureReproducible(outputTimestamp);
+        archiver.configureReproducibleBuild(outputTimestamp);
 
         try {
             String[] mainJarExcludes = DEFAULT_EXCLUDES;
@@ -224,7 +225,7 @@ public class AcrMojo extends AbstractMojo {
                             deploymentDescriptor,
                             true,
                             filterWrappers,
-                            getEncoding(unfilteredDeploymentDescriptor));
+                            getEncoding(unfilteredDeploymentDescriptor.toPath()));
                     // Remove the temporary file
                     FileUtils.forceDelete(unfilteredDeploymentDescriptor);
                 }
@@ -278,8 +279,9 @@ public class AcrMojo extends AbstractMojo {
      * @return The encoding of the XML-file, or UTF-8 if it's not specified in the file
      * @throws IOException if an error occurred while reading the file
      */
-    private String getEncoding(File xmlFile) throws IOException {
-        try (XmlStreamReader xmlReader = new XmlStreamReader(xmlFile)) {
+    private String getEncoding(Path xmlFile) throws IOException {
+        try (XmlStreamReader xmlReader =
+                XmlStreamReader.builder().setPath(xmlFile).get()) {
             return xmlReader.getEncoding();
         }
     }