Which JAXB version was used in Java 8?

天大地大妈咪最大 提交于 2021-02-08 06:52:49

问题


JAXB (Java Architecture for XML Binding) has been publised as Maven artifacts although it was bundled with JREs until Java 8 (and Java 9/10 with an option).

My question here is: Which JAXB version on Maven Central corresponds to Java 8's bundled version? (And, also for Java 9/10's under a feature option?)

I'm seeing in https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api :

  • 2.2.* (~ 2.2.12)
  • 2.3.0
  • 2.3.1
  • 2.4.0-* (under development)
  • (3.0.0 to be jakarta.xml.*)

回答1:


As far as Java 8:

$ $(/usr/libexec/java_home -v 1.8)/bin/xjc -version
xjc 2.2.8-b130911.1802

which is documented here specifying the Maven coordinates:

<dependency>
  <groupId>org.glassfish.jaxb</groupId>
  <artifactId>jaxb-bom</artifactId>
  <version>2.2.8</version>
  <type>pom</type>
</dependency>

although

          <dependency>                                                          
            <groupId>javax.xml.bind</groupId>                                   
            <artifactId>jaxb-api</artifactId>                                   
            <version>2.2.8</version>                                            
            <scope>provided</scope>                                             
          </dependency>

is accurate for Java 8. For Java 9+, the latest available (as you observed) is:

<dependency>
    <groupId>javax.xml.bind</groupId>
    <artifactId>jaxb-api</artifactId>
    <version>2.4.0-b180830.0359</version>
</dependency>


来源:https://stackoverflow.com/questions/63608553/which-jaxb-version-was-used-in-java-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!