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

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

commit 9fc7f414df35a3e9c032f4efd7f5e6229987b023
Author: Sylwester Lachiewicz <slachiew...@apache.org>
AuthorDate: Sat Apr 8 21:42:40 2023 +0200

    [MACR-54] Require Java 8
---
 pom.xml                                                 |  2 +-
 src/main/java/org/apache/maven/plugins/acr/AcrMojo.java | 16 +++-------------
 2 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/pom.xml b/pom.xml
index c9efc3d..50611b0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -62,7 +62,7 @@ under the License.
   </distributionManagement>
 
   <properties>
-    <javaVersion>7</javaVersion>
+    <javaVersion>8</javaVersion>
     <mavenVersion>3.0</mavenVersion>
     
<project.build.outputTimestamp>2020-04-07T21:04:00Z</project.build.outputTimestamp>
   </properties>
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 7bdd8d9..114c89e 100644
--- a/src/main/java/org/apache/maven/plugins/acr/AcrMojo.java
+++ b/src/main/java/org/apache/maven/plugins/acr/AcrMojo.java
@@ -23,7 +23,6 @@ import java.io.File;
 import java.io.IOException;
 import java.util.List;
 
-import org.apache.commons.io.IOUtils;
 import org.apache.commons.io.input.XmlStreamReader;
 import org.apache.maven.archiver.MavenArchiveConfiguration;
 import org.apache.maven.archiver.MavenArchiver;
@@ -200,7 +199,7 @@ public class AcrMojo
             if ( excludes != null && !excludes.isEmpty() )
             {
                 excludes.add( APP_CLIENT_XML );
-                mainJarExcludes = excludes.toArray( new 
String[excludes.size()] );
+                mainJarExcludes = excludes.toArray(new String[0]);
             }
 
             if ( outputDirectory.exists() )
@@ -295,18 +294,9 @@ public class AcrMojo
     private String getEncoding( File xmlFile )
         throws IOException
     {
-        XmlStreamReader xmlReader = null;
-        try
-        {
-            xmlReader = new XmlStreamReader( xmlFile );
-            final String encoding = xmlReader.getEncoding();
-            xmlReader.close();
-            xmlReader = null;
-            return encoding;
-        }
-        finally
+        try ( XmlStreamReader xmlReader = new XmlStreamReader( xmlFile ) )
         {
-            IOUtils.closeQuietly( xmlReader );
+            return xmlReader.getEncoding();
         }
     }
 }

Reply via email to