Commit 132a42fd authored by Tom Käsler's avatar Tom Käsler

Merge branch 'jdk11' into 'master'

Add support to build and run on Java 11

See merge request !142
parents 73fe0fe4 e40d8185
Pipeline #29539 passed with stages
in 2 minutes and 27 seconds
......@@ -13,6 +13,8 @@
<directory-server-version>1.5.5</directory-server-version>
<io.netty-version>4.1.37.Final</io.netty-version>
<org.aspectj-version>1.9.2</org.aspectj-version>
<javax-jaxb.version>2.3.1</javax-jaxb.version>
<graalvm.version>19.1.1</graalvm.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<timestamp>${maven.build.timestamp}</timestamp>
<sonar.language>java</sonar.language>
......@@ -148,6 +150,10 @@
</dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
......@@ -347,6 +353,16 @@
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</dependency>
<dependency>
<groupId>org.graalvm.js</groupId>
<artifactId>js</artifactId>
<version>${graalvm.version}</version>
</dependency>
<dependency>
<groupId>org.graalvm.js</groupId>
<artifactId>js-scriptengine</artifactId>
<version>${graalvm.version}</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
......@@ -455,6 +471,14 @@
<artifactId>aspectjtools</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Workaround: Override unnecessary dependency which causes compatibility issues. -->
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>${java.version}</version>
<scope>system</scope>
<systemPath>${project.basedir}/pom.xml</systemPath>
</dependency>
</dependencies>
</plugin>
<plugin>
......@@ -597,6 +621,13 @@
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${javax-jaxb.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
......@@ -611,6 +642,19 @@
</executions>
</plugin>
</plugins>
<!-- Workaround for JDK 11 support. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=539791 -->
<extensions>
<extension>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</extension>
<extension>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<version>1.0</version>
</extension>
</extensions>
</build>
<name>ARSnova Backend</name>
......
......@@ -28,7 +28,6 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import javax.script.Bindings;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
......@@ -56,7 +55,7 @@ import de.thm.arsnova.service.StatusService;
@Component
public class CouchDbInitializer implements ResourceLoaderAware {
private static final Logger logger = LoggerFactory.getLogger(CouchDbInitializer.class);
private final List<Bindings> docs = new ArrayList<>();
private final List<Map<String, Object>> docs = new ArrayList<>();
private ResourceLoader resourceLoader;
private MigrationExecutor migrationExecutor;
......@@ -83,7 +82,7 @@ public class CouchDbInitializer implements ResourceLoaderAware {
final String js = FileCopyUtils.copyToString(new InputStreamReader(resource.getInputStream()));
/* Reset designDoc before parsing a new one. */
engine.eval("var designDoc = null;" + js);
final Bindings jsonObject = (Bindings) engine.eval("jsToJson(designDoc)");
final Map<String, Object> jsonObject = (Map<String, Object>) engine.eval("jsToJson(designDoc)");
docs.add(jsonObject);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment