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

查看:132
本文介绍了使用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.activation javax.activation package

  • java.corba javax.activity javax.rmi javax.rmi.CORBA org.omg。* packages

  • java.transaction with javax.transaction package

  • java.xml.bind 所有 javax.xml.bind。* packages

  • java.xml.ws javax.jws javax.jws.soap javax.xml.soap ,以及所有 javax.xml.ws。*

  • java.xml.ws.annotation javax.annotation package

  • 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 Activiation Framework是一项独立技术(可在Maven Central上获得):

JavaBeans Activiation Framework is a standalone technology (available on Maven Central):

<dependency>
    <groupId>com.sun.activation</groupId>
    <artifactId>javax.activation</artifactId>
    <version>1.2.0</version>
</dependency>

来源

来自 JEP 320


除非第三方接管CORBA API,ORB实施,CosNaming提供商等的维护,否则不会有独立版本的CORBA。因为Java SE平台可以进行第三方维护支持CORBA的独立实现。相比之下,RMI-IIOP的API仅在Java SE中定义和实现。除非启动专用JSR来维护它,否则将不会有独立版本的RMI-IIOP,或者Eclipse的管理工作由Eclipse基金会接管(Java EE从JCP到Eclipse Foundation的管理权转移包括< a href =https://javaee.github.io/glassfish/\"rel =noreferrer> 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).

独立版本:

<dependency>
    <groupId>javax.transaction</groupId>
    <artifactId>javax.transaction-api</artifactId>
    <version>1.2</version>
</dependency>

Source ;看看如何使用 1.2 和即将到来的 1.3 在类和模块路径上。)

(Source; take a look for how to use 1.2 and the upcoming 1.3 on class and module path.)

参考实现:

<!-- Java 6 = JAXB version 2.0   -->
<!-- Java 7 = JAXB version 2.2.3 -->
<!-- Java 8 = JAXB version 2.2.8 -->
<!-- Java 9 = JAXB version 2.3.0 -->
<dependency>
    <groupId>javax.xml.bind</groupId>
    <artifactId>jaxb-api</artifactId>
    <version>2.2.8</version>
</dependency>
<dependency>
    <groupId>com.sun.xml.bind</groupId>
    <artifactId>jaxb-core</artifactId>
    <version>2.2.8</version>
</dependency>
<dependency>
    <groupId>com.sun.xml.bind</groupId>
    <artifactId>jaxb-impl</artifactId>
    <version>2.2.8</version>
</dependency>

来源; JEP 320 说明了从哪里获得 schemagen xjc 来自。)

(Source; JEP 320 explains where to get schemagen and xjc from.)

参考实现:

<dependency>
    <groupId>com.sun.xml.ws</groupId>
    <artifactId>jaxws-ri</artifactId>
    <version>2.3.0</version>
    <type>pom</type>
</dependency>

Source ;还解释了从哪里获得 wsgen wsimport 来自。)

(Source; also explains where to get wsgen and wsimport from.)

Java Commons Annotations (Maven Central提供):

Java Commons Annotations (available on Maven Central):

<dependency>
    <groupId>javax.annotation</groupId>
    <artifactId>javax.annotation-api</artifactId>
    <version>1.3.1</version>
</dependency>

来源

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

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