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 @@ protected void generateSignatureForFile(File file, File signature) throws MojoEx 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 @@ 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.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 @@ private void processModel(Model model) { * @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 @@ private File generatePomFile() throws MojoExecutionException { 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;