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

cstamas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-gpg-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new 5b94273  [MGPG-141] Remove use of deprecated classes (#117)
5b94273 is described below

commit 5b9427333ab4b7b48b297a8b9a4158688211f14a
Author: Tamas Cservenak <ta...@cservenak.net>
AuthorDate: Tue Sep 10 18:38:44 2024 +0200

    [MGPG-141] Remove use of deprecated classes (#117)
    
    The MGPG-138 also updated plexus-utils to 4.0.1 and plexus-xml to 3.0.1.
    
    ---
    
    https://issues.apache.org/jira/browse/MGPG-141
---
 src/main/java/org/apache/maven/plugins/gpg/GpgSigner.java  |  2 +-
 .../apache/maven/plugins/gpg/SignAndDeployFileMojo.java    | 14 ++++++--------
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/gpg/GpgSigner.java 
b/src/main/java/org/apache/maven/plugins/gpg/GpgSigner.java
index b4f9e08..98d5331 100644
--- a/src/main/java/org/apache/maven/plugins/gpg/GpgSigner.java
+++ b/src/main/java/org/apache/maven/plugins/gpg/GpgSigner.java
@@ -74,7 +74,7 @@ public class GpgSigner extends AbstractGpgSigner {
             throw new MojoExecutionException("Could not determine gpg 
version");
         }
 
-        getLog().debug(gpgVersion.toString());
+        getLog().debug("GPG Version: " + gpgVersion);
 
         if (args != null) {
             for (String arg : args) {
diff --git 
a/src/main/java/org/apache/maven/plugins/gpg/SignAndDeployFileMojo.java 
b/src/main/java/org/apache/maven/plugins/gpg/SignAndDeployFileMojo.java
index e4853fc..db4e09c 100644
--- a/src/main/java/org/apache/maven/plugins/gpg/SignAndDeployFileMojo.java
+++ b/src/main/java/org/apache/maven/plugins/gpg/SignAndDeployFileMojo.java
@@ -21,8 +21,8 @@ package org.apache.maven.plugins.gpg;
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
-import java.io.Reader;
-import java.io.Writer;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.nio.file.Files;
 import java.util.ArrayList;
 import java.util.List;
@@ -46,9 +46,7 @@ import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.project.MavenProject;
 import org.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.util.ReaderFactory;
 import org.codehaus.plexus.util.StringUtils;
-import org.codehaus.plexus.util.WriterFactory;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 import org.eclipse.aether.RepositorySystem;
 import org.eclipse.aether.artifact.Artifact;
@@ -401,8 +399,8 @@ public class SignAndDeployFileMojo extends AbstractGpgMojo {
      * @throws MojoExecutionException If the file doesn't exist of cannot be 
read.
      */
     private Model readModel(File pomFile) throws MojoExecutionException {
-        try (Reader reader = ReaderFactory.newXmlReader(pomFile)) {
-            return new MavenXpp3Reader().read(reader);
+        try (InputStream inputStream = Files.newInputStream(pomFile.toPath())) 
{
+            return new MavenXpp3Reader().read(inputStream);
         } catch (FileNotFoundException e) {
             throw new MojoExecutionException("POM not found " + pomFile, e);
         } catch (IOException e) {
@@ -425,8 +423,8 @@ public class SignAndDeployFileMojo extends AbstractGpgMojo {
             File tempFile = Files.createTempFile("mvndeploy", ".pom").toFile();
             tempFile.deleteOnExit();
 
-            try (Writer fw = WriterFactory.newXmlWriter(tempFile)) {
-                new MavenXpp3Writer().write(fw, model);
+            try (OutputStream outputStream = 
Files.newOutputStream(tempFile.toPath())) {
+                new MavenXpp3Writer().write(outputStream, model);
             }
 
             return tempFile;

Reply via email to