jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject svn commit: r1863646 - /jackrabbit/commons/filevault-package-maven-plugin/trunk/src/test/java/org/apache/jackrabbit/filevault/maven/packaging/it/ProjectBuilder.java
Date Tue, 23 Jul 2019 15:44:45 GMT
Author: kwin
Date: Tue Jul 23 15:44:45 2019
New Revision: 1863646

URL: http://svn.apache.org/viewvc?rev=1863646&view=rev
Log:
JCRVLT-342 close pom.xml correctly after retrieving version

Modified:
    jackrabbit/commons/filevault-package-maven-plugin/trunk/src/test/java/org/apache/jackrabbit/filevault/maven/packaging/it/ProjectBuilder.java

Modified: jackrabbit/commons/filevault-package-maven-plugin/trunk/src/test/java/org/apache/jackrabbit/filevault/maven/packaging/it/ProjectBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault-package-maven-plugin/trunk/src/test/java/org/apache/jackrabbit/filevault/maven/packaging/it/ProjectBuilder.java?rev=1863646&r1=1863645&r2=1863646&view=diff
==============================================================================
--- jackrabbit/commons/filevault-package-maven-plugin/trunk/src/test/java/org/apache/jackrabbit/filevault/maven/packaging/it/ProjectBuilder.java
(original)
+++ jackrabbit/commons/filevault-package-maven-plugin/trunk/src/test/java/org/apache/jackrabbit/filevault/maven/packaging/it/ProjectBuilder.java
Tue Jul 23 15:44:45 2019
@@ -123,10 +123,10 @@ public class ProjectBuilder {
     private String getPluginVersion() {
         String pluginVersion  = System.getProperty("plugin.version");
         if (pluginVersion == null) {
-            try {
+            try (FileReader fileReader = new FileReader("pom.xml")) {
                 // try to read from project
                 MavenXpp3Reader reader = new MavenXpp3Reader();
-                Model model = reader.read(new FileReader("pom.xml"));
+                Model model = reader.read(fileReader);
                 pluginVersion = model.getVersion();
             } catch (IOException | XmlPullParserException e) {
                 log.error("Unable to read version from pom", e);



Mime
View raw message