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

Commits on Mar 24, 2022

  1. Upgrade to Java 11 by bringing in removed artifact.

    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/
    kaladay committed Mar 24, 2022
    Configuration menu
    Copy the full SHA
    0a2b3bf View commit details
    Browse the repository at this point in the history