package org.utplsql.api;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URISyntaxException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;

/** This class is getting updated automatically by the build process.
 * Please do not update its constants manually cause they will be overwritten.
 *
 * @author pesse
 */
public class JavaApiVersionInfo {

    private JavaApiVersionInfo() { }


    private static final String MAVEN_PROJECT_NAME = "utPLSQL-java-api";
    private static String MAVEN_PROJECT_VERSION = "unknown";

    static {
        try {
            MAVEN_PROJECT_VERSION = Files.readAllLines(
                    Paths.get(JavaApiVersionInfo.class.getClassLoader().getResource("utplsql-api.version").toURI())
                    , Charset.defaultCharset())
                    .get(0);
        }
        catch ( IOException | URISyntaxException e ) {
            System.out.println("WARNING: Could not get Version information!");
        }
    }

    public static String getVersion() { return MAVEN_PROJECT_VERSION; }
    public static String getInfo() { return MAVEN_PROJECT_NAME + " " + getVersion(); }

}

@@ -19,16 +19,47 @@
 l.api;%0A%0A
+import java.io.BufferedReader;%0A
 import j
@@ -675,16 +675,17 @@
   try %7B%0A
+%0A
         
@@ -692,82 +692,31 @@
     
-MAVEN_PROJECT_VERSION = Files.readAllLines(%0A                    Paths.get(
+try ( InputStream in = 
 Java
@@ -764,16 +764,24 @@
 Resource
+AsStream
 (%22utplsq
@@ -799,17 +799,11 @@
 on%22)
-.toURI())
+) %7B
 %0A   
@@ -819,39 +819,78 @@
     
-    , Charset.defaultCharset(
+BufferedReader reader = new BufferedReader(new InputStreamReader(in
 ))
+;
 %0A   
@@ -906,20 +906,97 @@
     
-    .get(0);
+MAVEN_PROJECT_VERSION = reader.readLine();%0A%0A                reader.close();%0A            %7D
 %0A   
@@ -1034,29 +1034,8 @@
 ion 
-%7C URISyntaxException 
 e ) 

Use ResourceStream instead of NIO File access