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

Upgrade to Java 11 by bringing in removed artifact. #150

Closed
wants to merge 1 commit into from

Conversation

kaladay
Copy link
Contributor

@kaladay kaladay commented Mar 24, 2022

These jaxb-api artifact was removed from the default bundle.
This module is still available in java, but as a separate artifact.

If the goal is to make this JDK11+ only, then the following can be added to the pom.xml (under <properties>):

  <java.version>11</java.version>
  <maven.compiler.release>11</maven.compiler.release>

However, it makes more sense to me to omit that as the current changes still work under JDK8.
This means JDK8 is still supported by the changes in this commit.

The jaxb, however, is deprecated or possibly deprecated (see link below).
This means using a more future compatible approach of using jakarta.xml.bind and org.glassfish.jaxb.

There is also versions 3.0.x of these under new paths:

<!-- JAXB API v3.0.1 -->
<dependency>
    <groupId>jakarta.xml.bind</groupId>
    <artifactId>jakarta.xml.bind-api</artifactId>
    <version>3.0.1</version>
</dependency>

<!-- JAXB v3.0.2 reference implementation (curiously with com.sun coordinates) -->
<dependency>
    <groupId>com.sun.xml.bind</groupId>
    <artifactId>jaxb-impl</artifactId>
    <version>3.0.2</version>
    <scope>runtime</scope>
</dependency>

These, however, are avoided for now to ensure compatibility between jdk8 and jdk11.

see: https://stackoverflow.com/questions/43574426/how-to-resolve-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception/43574427#43574427
see: http://openjdk.java.net/jeps/320
see: spring-projects/spring-boot#11205
see: https://nipafx.dev/java-11-migration-guide/
see: https://jesperdj.com/2018/09/30/jaxb-on-java-9-10-11-and-beyond/

These jaxb-api artifact was removed from the default bundle.
This module is still available in java, but as a separate artifact.

If the goal is to make this JDK11+ only, then the following can be added to the pom.xml (under `<properties>`):
```
  <java.version>11</java.version>
  <maven.compiler.release>11</maven.compiler.release>
```

However, it makes more sense to me to omit that as the current changes still work under JDK8.
This means JDK8 is still supported by the changes in this commit.

The jaxb, however, is deprecated or possibly deprecated (see link below).
This means using a more future compatible approach of using `jakarta.xml.bind` and `org.glassfish.jaxb`.

There is also versions 3.0.x of these under new paths:
```
<!-- JAXB API v3.0.1 -->
<dependency>
    <groupId>jakarta.xml.bind</groupId>
    <artifactId>jakarta.xml.bind-api</artifactId>
    <version>3.0.1</version>
</dependency>

<!-- JAXB v3.0.2 reference implementation (curiously with com.sun coordinates) -->
<dependency>
    <groupId>com.sun.xml.bind</groupId>
    <artifactId>jaxb-impl</artifactId>
    <version>3.0.2</version>
    <scope>runtime</scope>
</dependency>
```

These, however, are avoided for now to ensure compatibility between jdk8 and jdk11.

see: https://stackoverflow.com/questions/43574426/how-to-resolve-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception/43574427#43574427
see: http://openjdk.java.net/jeps/320
see: spring-projects/spring-boot#11205
see: https://nipafx.dev/java-11-migration-guide/
see: https://jesperdj.com/2018/09/30/jaxb-on-java-9-10-11-and-beyond/
@coveralls
Copy link

Coverage Status

Coverage remained the same at 96.121% when pulling 0a2b3bf on java11-migration-compatible into 6872e27 on master.

@ghost ghost linked an issue Jun 20, 2022 that may be closed by this pull request
6 tasks
@kaladay kaladay closed this Aug 3, 2022
@kaladay kaladay deleted the java11-migration-compatible branch August 3, 2022 18:43
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.

Upgrade Weaver-Webservice-Core (2.1.1-RC11)
2 participants