英文:
Which JAXB version was used in Java 8?
问题
JAXB(Java Architecture for XML Binding)已经作为Maven构件发布,尽管在Java 8之前(以及Java 9/10选择性地)它是与JRE捆绑在一起的。
我在这里的问题是:Maven中央仓库中哪个JAXB版本对应于Java 8捆绑版本?(还有,对于Java 9/10,在一个功能选项下是什么版本?)
我在https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api 上看到:
- 2.2.*(~ 2.2.12)
- 2.3.0
- 2.3.1
- 2.4.0-*(正在开发中)
- (3.0.0将成为
jakarta.xml.*
)
英文:
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
得分: 11
截止到Java 8版本:
$ $(/usr/libexec/java_home -v 1.8)/bin/xjc -version
xjc 2.2.8-b130911.1802
相关文档可在此处找到,其中指定了Maven坐标:
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-bom</artifactId>
<version>2.2.8</version>
<type>pom</type>
</dependency>
不过对于Java 8,准确的依赖如下:
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2.8</version>
<scope>provided</scope>
</dependency>
至于Java 9+,最新可用的依赖(正如您所观察到的)是:
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.4.0-b180830.0359</version>
</dependency>
英文:
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>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论