From 3140a373a1f1a710e725b5fdcac03461415a8ad4 Mon Sep 17 00:00:00 2001 From: Peter Hormanns Date: Wed, 15 Nov 2023 17:15:28 +0100 Subject: [PATCH] hsscript and java17 --- cli/pom.xml | 24 ++++++++++++------- .../java/de/hsadmin/jscli/ScriptClient.java | 6 +++-- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index b024c88..e89b3a1 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -1,14 +1,14 @@ - + 4.0.0 de.hsadmin hsadmin-parent - 1.0.3 + 1.0.4 hsadmin-cli - 1.2.0 + 1.3.0 jar HSAdmin-Cli @@ -37,12 +37,17 @@ jline jline - 2.14.5 + 2.14.6 commons-cli commons-cli - 1.4 + 1.6.0 + + + org.openjdk.nashorn + nashorn-core + 15.4 @@ -73,12 +78,13 @@ org.vafer jdeb - 1.5 + 1.10 true - ${project.build.directory}/${project.build.finalName}-jar-with-dependencies.jar + + ${project.build.directory}/${project.build.finalName}-jar-with-dependencies.jar hsscript-full.jar file diff --git a/cli/src/main/java/de/hsadmin/jscli/ScriptClient.java b/cli/src/main/java/de/hsadmin/jscli/ScriptClient.java index 5cc1ef3..fa3bc53 100644 --- a/cli/src/main/java/de/hsadmin/jscli/ScriptClient.java +++ b/cli/src/main/java/de/hsadmin/jscli/ScriptClient.java @@ -33,8 +33,10 @@ public class ScriptClient { completionStrings.add("where"); considerArguments(arguments); try { - final InputStream inputResource = getClass().getClassLoader().getResourceAsStream("js/functions.js"); - engine.eval(new InputStreamReader(inputResource)); + final ClassLoader classLoader = getClass().getClassLoader(); + final InputStream inputResource = classLoader.getResourceAsStream("js/functions.js"); + final InputStreamReader inputStreamReader = new InputStreamReader(inputResource); + engine.eval(inputStreamReader); } catch (ScriptException e) { throw new JSCliException(e); }