8.3.6. How to Setup When Using With Java11¶
When using blank projects in Java 11, perform the following procedure before communication confirmation of each blank project.
- Add dependent module
- Add dependent module used by gsp-dba-maven-plugin
- Change of Jetty module used in automatic test (only for web projects or RESTful web service projects)
- Change of Java Version
Tip
The blank project for containers assumes Java 11, and the modifications described in this chapter have been applied beforehand. Therefore, in a blank project for containers the procedures of this chapter are not necessary.
8.3.6.1. Add dependent module¶
With Java 11, some modules, such as JAXB, have been removed from the standard library. Removed modules need to be explicitly added to dependencies. Therefore, add the following modules to the created blank project POM.
<dependencies>
<!-- Omitted -->
<!-- Add the following. -->
<dependency>
<groupId>com.sun.activation</groupId>
<artifactId>javax.activation</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
</dependencies>
8.3.6.2. Add dependent module used by gsp-dba-maven-plugin¶
Configure by referring to the following.
Configuration in Java11 (external site)
8.3.6.3. Change of Jetty module used in automatic test (only for web projects or RESTful web service projects)¶
The Jetty version which is configured by default in the blank project does not support Java11. Therefore, make changes to 2 files as given below.
- pom.xml
<!-- Change the location of nablarch-testing-jetty6 as follows -->
<dependency>
<groupId>com.nablarch.framework</groupId>
<artifactId>nablarch-testing-jetty9</artifactId>
<scope>test</scope>
</dependency>
- src/test/resources/unit-test.xml
<!-- Change the location of HttpServerFactoryJetty6 as follows -->
<component name="httpServerFactory" class="nablarch.fw.web.httpserver.HttpServerFactoryJetty9"/>
8.3.6.4. Change of Java Version¶
In a blank project, Java 8 is set as the Java version that the source and class files conform to, so change the file as below.
- pom.xml
<!-- Change Java version as follows -->
<java.version>11</java.version>