diff --git a/.travis.yml b/.travis.yml index 377d375..989f195 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: java jdk: - - oraclejdk8 + - openjdk17 branches: only: diff --git a/copybook4java-codegen-maven-plugin/pom.xml b/copybook4java-codegen-maven-plugin/pom.xml index c3f00a1..f407f56 100644 --- a/copybook4java-codegen-maven-plugin/pom.xml +++ b/copybook4java-codegen-maven-plugin/pom.xml @@ -4,12 +4,12 @@ com.nordea.oss copybook4java-codegen-maven-plugin - 1.0.6 + 1.2.0 UTF-8 - 3.3.9 - 3.4 + 3.8.7 + 3.7.1 maven-plugin @@ -83,8 +83,8 @@ maven-compiler-plugin 3.5.1 - 1.8 - 1.8 + 17 + 17 -Xlint:all true true @@ -93,7 +93,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.3 + 1.6.13 true ossrh @@ -104,7 +104,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.18 + 2.22.2 methods 10 @@ -112,7 +112,7 @@ maven-scm-plugin - 1.8.1 + 1.13.0 v${project.version} @@ -120,7 +120,7 @@ org.codehaus.mojo versions-maven-plugin - 2.1 + 2.14.2 false @@ -186,7 +186,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 2.9.1 + 2.10.4 attach-javadocs @@ -199,7 +199,7 @@ org.apache.maven.plugins maven-gpg-plugin - 1.5 + 1.6 sign-artifacts @@ -223,6 +223,13 @@ 1.0.3 + + + org.openjdk.nashorn + nashorn-core + 15.4 + + org.apache.maven diff --git a/copybook4java-codegen-maven-plugin/src/main/java/com/nordea/oss/copybook/codegen/CopyBookConverter.java b/copybook4java-codegen-maven-plugin/src/main/java/com/nordea/oss/copybook/codegen/CopyBookConverter.java index aaec3cc..8c42a3e 100644 --- a/copybook4java-codegen-maven-plugin/src/main/java/com/nordea/oss/copybook/codegen/CopyBookConverter.java +++ b/copybook4java-codegen-maven-plugin/src/main/java/com/nordea/oss/copybook/codegen/CopyBookConverter.java @@ -7,7 +7,7 @@ package com.nordea.oss.copybook.codegen; import com.nordea.oss.ByteUtils; -import jdk.nashorn.api.scripting.ScriptObjectMirror; +import org.openjdk.nashorn.api.scripting.ScriptObjectMirror; import javax.script.*; import java.io.*; @@ -29,7 +29,7 @@ public CopyBookConverter() throws Exception { InputStream inputStream = this.getClass().getResourceAsStream("classconverter.html"); String js = extractJS(inputStream); - manager = new ScriptEngineManager(null); + manager = new ScriptEngineManager(); engine = manager.getEngineByName("nashorn"); if(engine == null) { diff --git a/copybook4java-codegen-maven-plugin/src/test/java/com/nordea/oss/copybook/codegen/JavaSyntaxChecker.java b/copybook4java-codegen-maven-plugin/src/test/java/com/nordea/oss/copybook/codegen/JavaSyntaxChecker.java index 140a662..57e7660 100644 --- a/copybook4java-codegen-maven-plugin/src/test/java/com/nordea/oss/copybook/codegen/JavaSyntaxChecker.java +++ b/copybook4java-codegen-maven-plugin/src/test/java/com/nordea/oss/copybook/codegen/JavaSyntaxChecker.java @@ -38,7 +38,7 @@ public static List check(List sources) throws Exception { StandardJavaFileManager fileManager = javac.getStandardFileManager(null, null, StandardCharsets.UTF_8); DiagnosticCollector diagnostics = new DiagnosticCollector<>(); - JavaCompiler.CompilationTask task = javac.getTask(null, new InMemmoryFileManager(javac.getStandardFileManager(null, null, null)), diagnostics, null, null, stringSourceCodes); + JavaCompiler.CompilationTask task = javac.getTask(null, new InMemoryFileManager(fileManager), diagnostics, null, null, stringSourceCodes); task.call(); List errors = new ArrayList<>(); @@ -62,11 +62,11 @@ public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOExcept } } - private static class InMemmoryFileManager implements JavaFileManager { + private static class InMemoryFileManager implements JavaFileManager { private final StandardJavaFileManager fileManager; private final Map buffers = new LinkedHashMap<>(); - InMemmoryFileManager(StandardJavaFileManager fileManager) { + InMemoryFileManager(StandardJavaFileManager fileManager) { this.fileManager = fileManager; } @@ -125,7 +125,7 @@ public FileObject getFileForOutput(Location location, String packageName, String return fileManager.getFileForOutput(location, packageName, relativeName, sibling); } - public void flush() throws IOException { + public void flush() { // Do nothing } @@ -136,6 +136,13 @@ public void close() throws IOException { public int isSupportedOption(String option) { return fileManager.isSupportedOption(option); } - } + public String inferModuleName(Location location) throws IOException { + return fileManager.inferModuleName(location); + } + + public Iterable> listLocationsForModules(Location location) throws IOException { + return fileManager.listLocationsForModules(location); + } + } } diff --git a/copybook4java-codegen-maven-test/pom.xml b/copybook4java-codegen-maven-test/pom.xml index 6f90a0a..b8d6bc0 100644 --- a/copybook4java-codegen-maven-test/pom.xml +++ b/copybook4java-codegen-maven-test/pom.xml @@ -19,10 +19,10 @@ maven-compiler-plugin - 3.2 + 3.8.1 - 1.8 - 1.8 + 17 + 17 -Xlint:all true true @@ -31,7 +31,7 @@ com.nordea.oss copybook4java-codegen-maven-plugin - 1.0.6 + 1.2.0 ^.*\.txt$ src/test/resources/