Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to build/run on Java 11 #640

Closed
wants to merge 1 commit into from

Conversation

fmbenhassine
Copy link
Contributor

This PR resolves BATC-2757.

It fixes compilation/test issues on Java 11 due to the removal of JAXB from the JDK (See JEP-320). More details in the commit message.

The asciidoc task fails on Java 11 due to a transitive dependency of jruby (jruby-openssl) which is not compatible yet with Java 11 (See https://github.com/jruby/jruby-openssl#compatibility).

So this PR can be tested using the following command: ./gradlew clean build -x asciidoc. The build should succeed with Open JDK 11 ea 28 (from SDKMAN 11.ea.28-open).

Note: This PR should be merged after #639.

This is required to be able to test against Java 11. In Java 11, JAXB is
removed from the JDK (See http://openjdk.java.net/jeps/320). This commit
fixes errors of type:

```
StaxEventItemWriterTests.java:22: error: package javax.xml.bind.annotation
does not exist: import javax.xml.bind.annotation.XmlRootElement;
```

Two important points (from JEP 320) to note about this commit:

* `Another risk of removing the Java EE modules is that applications
 which already migrated from JDK 6, 7, or 8, to JDK 9, will not start if
 they use the command line flag --add-modules java.se.ee,
 --add-modules java.xml.bind, etc.` This commit removes the need to add
 the flag `--add-modules java.xml.bind`. This removal does not impact
 building on Java 9 since JAXB is in the class path now.

 * `The Reference Implementations (RIs) of JAX-WS and JAXB are a good
 starting point because they are complete replacements for the
 java.xml.ws and java.xml.bind modules in JDK 9. The RIs are available
 as Maven artifacts: (note that they must be deployed on the class path)`
 This commit adds JAXB to the test class path where needed.

Issue: BATCH-2757
@mminella
Copy link
Member

LGTM. Merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants