hsscript and java17

This commit is contained in:
Peter Hormanns 2023-11-15 17:15:28 +01:00
parent 74639d93c5
commit 3140a373a1
2 changed files with 19 additions and 11 deletions

View File

@ -1,14 +1,14 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.hsadmin</groupId>
<artifactId>hsadmin-parent</artifactId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<artifactId>hsadmin-cli</artifactId>
<version>1.2.0</version>
<version>1.3.0</version>
<packaging>jar</packaging>
<name>HSAdmin-Cli</name>
@ -37,12 +37,17 @@
<dependency>
<groupId>jline</groupId>
<artifactId>jline</artifactId>
<version>2.14.5</version>
<version>2.14.6</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.4</version>
<version>1.6.0</version>
</dependency>
<dependency>
<groupId>org.openjdk.nashorn</groupId>
<artifactId>nashorn-core</artifactId>
<version>15.4</version>
</dependency>
</dependencies>
<build>
@ -73,12 +78,13 @@
<plugin>
<groupId>org.vafer</groupId>
<artifactId>jdeb</artifactId>
<version>1.5</version>
<version>1.10</version>
<configuration>
<verbose>true</verbose>
<dataSet>
<data>
<src>${project.build.directory}/${project.build.finalName}-jar-with-dependencies.jar</src>
<src>
${project.build.directory}/${project.build.finalName}-jar-with-dependencies.jar</src>
<dst>hsscript-full.jar</dst>
<type>file</type>
<mapper>

View File

@ -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);
}