使用 Java EE API 替换已弃用的 JPMS 模块 [英] Replacements for deprecated JPMS modules with Java EE APIs

查看:36
本文介绍了使用 Java EE API 替换已弃用的 JPMS 模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Java 9 弃用的六个模块包含 Java EE API 并且它们即将被移除:

Java 9 deprecated six modules that contain Java EE APIs and they are going to be removed soon:

  • java.activationjavax.activation
  • java.corbajavax.activityjavax.rmijavax.rmi.CORBAorg.omg.*
  • java.transactionjavax.transaction
  • java.xml.bind 包含所有 javax.xml.bind.*
  • java.xml.wsjavax.jwsjavax.jws.soapjavax.xml.soap,以及所有 javax.xml.ws.*
  • java.xml.ws.annotationjavax.annotation
  • java.activation with javax.activation package
  • java.corba with javax.activity, javax.rmi, javax.rmi.CORBA, and org.omg.* packages
  • java.transaction with javax.transaction package
  • java.xml.bind with all javax.xml.bind.* packages
  • java.xml.ws with javax.jws, javax.jws.soap, javax.xml.soap, and all javax.xml.ws.* packages
  • java.xml.ws.annotation with javax.annotation package

哪些维护的第三方工件提供这些 API?他们提供这些 API 的效果有多好或他们必须提供哪些其他功能并不重要——重要的是,它们是这些模块/包的直接替代品吗?

Which maintained third-party artifacts provide those APIs? It doesn't matter how well they provide those APIs or which other features they have to offer - all that matters is, are they a drop-in replacement for these modules/packages?

为了更容易收集知识,我用我目前所知道的来回答,并将答案设为社区维基.我希望人们能扩展它而不是自己写答案.

To make it easier to collect knoweldge, I answered with what I know so far and made the answer a community wiki. I hope people will extend it instead of writing their own answers.

在您投票关闭之前:

  • 是的,已经有一些关于各个模块的问题,这个问题的答案当然会重复该信息.但 AFAIK 没有任何一点可以了解所有这些,我认为这很有价值.
  • 要求图书馆推荐的问题通常被认为是题外话,因为它们往往会吸引自以为是的答案和垃圾邮件",但我认为这不适用于这里.一组有效的库被清楚地描述:它们必须实现特定的标准.除此之外,其他一切都不重要,所以我认为意见和垃圾邮件的风险不大.

推荐答案

不要使用已弃用的 Java EE 模块,而是使用以下工件.

Instead of using the deprecated Java EE modules, use the following artifacts.

JavaBeans Activation Framework(现为 Jakarta Activation)是一项独立技术(可在 Maven Central 上使用):

JavaBeans Activation Framework (now Jakarta Activation) is a standalone technology (available on Maven Central):

<dependency>
    <groupId>com.sun.activation</groupId>
    <artifactId>jakarta.activation</artifactId>
    <version>1.2.2</version>
</dependency>

(来源)

来自 JEP 320:

除非第三方接管 CORBA API、ORB 实现、CosNaming 提供程序等的维护,否则不会有 CORBA 的独立版本.第三方维护是可能的,因为 Java SE 平台认可 CORBA 的独立实现.相比之下,RMI-IIOP 的 API 仅在 Java SE 中定义和实现.除非有专门的 JSR 来维护它,否则不会有独立版本的 RMI-IIOP,或者 API 的管理权由 Eclipse 基金会接管(Java EE 的管理权从 JCP 到 Eclipse 基金会的过渡包括 GlassFish 及其对 CORBA 和 RMI-IIOP 的实现.

There will not be a standalone version of CORBA unless third parties take over maintenance of the CORBA APIs, ORB implementation, CosNaming provider, etc. Third party maintenance is possible because the Java SE Platform endorses independent implementations of CORBA. In contrast, the API for RMI-IIOP is defined and implemented solely within Java SE. There will not be a standalone version of RMI-IIOP unless a dedicated JSR is started to maintain it, or stewardship of the API is taken over by the Eclipse Foundation (the transition of stewardship of Java EE from the JCP to the Eclipse Foundation includes GlassFish and its implementation of CORBA and RMI-IIOP).

JTA (java.transaction)

独立版本:

JTA (java.transaction)

Stand alone version:

<dependency>
    <groupId>jakarta.transaction</groupId>
    <artifactId>jakarta.transaction-api</artifactId>
    <version>1.3.3</version>
</dependency>

(来源)

自从 Java EE 更名为 Jakarta EE,JAXB 现在由新的工件提供:

Since Java EE was rebranded to Jakarta EE, JAXB is now provided by new artifacts:

<!-- API -->
<dependency>
    <groupId>jakarta.xml.bind</groupId>
    <artifactId>jakarta.xml.bind-api</artifactId>
    <version>2.3.3</version>
</dependency>

<!-- Runtime -->
<dependency>
    <groupId>com.sun.xml.bind</groupId>
    <artifactId>jaxb-impl</artifactId>
    <version>2.3.3</version>
    <scope>runtime</scope>
</dependency>

<!-- Alternative runtime -->
<dependency>
    <groupId>org.glassfish.jaxb</groupId>
    <artifactId>jaxb-runtime</artifactId>
    <version>2.3.3</version>
    <scope>runtime</scope>
</dependency>

JAXB 参考实现页面.

替代运行时是 由阿比吉特·萨卡尔提出.

schemagenxjc 也可以作为独立 JAXB 发行版的一部分从那里下载.

schemagen and xjc can be downloaded from there too as part of a standalone JAXB distribution.

另见链接答案.

参考实现:

<!-- API -->
<dependency>
    <groupId>jakarta.xml.ws</groupId>
    <artifactId>jakarta.xml.ws-api</artifactId>
    <version>2.3.3</version>
</dependency>

<!-- Runtime -->
<dependency>
    <groupId>com.sun.xml.ws</groupId>
    <artifactId>jaxws-rt</artifactId>
    <version>2.3.3</version>
</dependency>

独立发行版下载(包含wsgenwsimport).

Java Commons Annotations(在 Maven Central 上可用):

Java Commons Annotations (available on Maven Central):

<dependency>
    <groupId>jakarta.annotation</groupId>
    <artifactId>jakarta.annotation-api</artifactId>
    <version>1.3.5</version>
</dependency>

(来源)

这篇关于使用 Java EE API 替换已弃用的 JPMS 模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆