关于java:Jakarta-EE-2020战果总结

3次阅读

共计 5403 个字符,预计需要花费 14 分钟才能阅读完成。

从 Eclipse 基金接过 java EE 的接力棒已有两年多了,因为 Oracle 回绝交出 javax 名称空间的使用权, Eclipse 基金只能新建一个名称空间 Jakarta. 从官网的标准来看还是战果累累。Eclipse 基金当初实现了 Jakarta8,9 的 release。其关联社区 (Redhat,JBoss) 的好多框架都实现了适度

Jakarta8(+)

在 Java EE 版本和最后的 Jakarta EE 8 版本中,Oracle 在驱动标准,GlassFish 实现和 TCK 技术方面起着领导作用,而在 Jakarta EE 9 中,这些角色由 Kevin Sutter(平台标准),Steve Millidge 领导。(GlassFish)和 Scott Marlow(TCK)在更宽泛的 Jakarta EE 社区做出了重大贡献。

Jakarta9(+)

Jakarta EE 9 是凋谢的,社区驱动的,与供应商无关的过程的后果。Jakarta EE 9 将 javax。名称空间的应用转换为 jakarta。名称空间,以使标准的将来翻新成为可能。

源文地址:Jakarta EE 9 is Released

A: Servlet 容器 /EE 应用服务器

1. Tomcat

从 Tomcat 的官网上看 10 是应用 Jakarta EE,目前还处于 beta. 9 是 javax 的版本. 官网地址:

2. Jetty

Eclipse 基金自已的 Servlet 容器。所以曾经实现适度。jetty 11 应用 Jakarta EE 曾经 release. jetty 10 是 javax 的版本。官网地址: https://www.eclipse.org/jetty/download.php

3. Undertow

Jboss 社区开发的 Servlet 容器,网上流传的是性能目前来看最好的一个。这也是 SpringBoot 反对的内置容器。从 github 上公布的版本来看已有 Jakarta EE 的多个版本。官网地址: https://github.com/undertow-io/undertow

4. GlassFish

开发保护的势力交给了 Eclipse 基金。这是 EE 规范的实现参考。javax 能用的最初一个版本是:5.0。Jakarta EE 曾经有多个版本 release。官网地址: https://javaee.github.io/glassfish/

5. WildFly

原名 JBoss. 当初是红帽子基金旗下的 EE 应用服务器。内置的 Servlet 容器是 Undertow,javax 能用的最初一个版本是:20.0.1.Final。Jakarta EE 曾经有多个版本 release。官网地址: https://www.wildfly.org/downloads/

6. WebLogic(*)

这是 Oracle 旗下的 EE 应用服务器。Jakarta EE 8 的 release 版本:14.1.1.0(https://jakarta.ee/compatibility/download/)。

7. WebSphere(*)

这是 IBM 旗下的 EE 应用服务器。Jakarta EE 8 的 release 版本:20.0.0.3(https://jakarta.ee/compatibility/download/)

总结:

从 Servlet 容器和应用服务器来看. Jakarta EE 的生态已趋残缺。但开发我的项目除了布署的容器和服务器还要看利用框架.

B: 利用框架

1. Spring Framework

从 github 上 spring framework 的 issues:Support for Jakarta EE 9 (annotations and interfaces in jakarta.* namespace)上看,原文:

We have no immediate plans to make such a switch, and also no plans for an early access branch. Our upcoming Spring Framework 5.3 generation will be compatible with Java 8+ and based on the javax-namespaced EE 8 APIs still, for immediate use in current production environments. Beyond that, Spring Framework 6 is likely to adopt the jakarta namespace at a later point.

The jakarta-namespaced APIs are not final yet and we expect a long time to go by before all major providers support them in production releases. We not only need Tomcat, Jetty and Undertow but also EclipseLink, Hibernate ORM and Hibernate Validator to provide major releases here, plus several special-purpose providers and libraries, before we can consider a version of Spring based on jakarta-namespaced APIs. Since there is no relevant value add in EE 9’s namespace change per se, backwards compatibility with existing application servers and persistence providers through the javax namespace is more important to us.

That said, if you have a production-targeting stack scenario where our continued use of the javax namespace is an issue, please elaborate. We are aware that the upcoming Tomcat 10 cannot be supported quite yet and recommend sticking with Tomcat 9.0.x (which is feature-equivalent with Tomcat 10, just still based on the javax namespace) for the time being.

一句话总结:

咱们可能在 6 反对 Jakarta EE. 起因: 咱们等依赖的框架都适度完后咱们才能够来整合

2. Struts

官网的下载地址上没有看到反对 Jakarta EE 的版本。官网地址: https://struts.apache.org/download.cgi。Jakarta EE 反对一个新的标准:Jakarta MVC,让前端这些框架的处境有点难看。

@Path("hello")
public class HelloController {

    @Inject
    private User user;

    @GET
    @Controller
    public String hello(@QueryParam("name") String name) {user.setName(name);
        return "hello.jsp";
    }
}

Maven 依赖:

<dependency>
  <groupId>jakarta.mvc</groupId>
  <artifactId>jakarta.mvc-api</artifactId>
  <version>2.0.0</version>
</dependency>

3. JPA 标准(Jakarta EE8/JPA2.2; Jakarta EE9/JPA3.0):

3.1 Hibernate(*)

对 JPA 的反对还是应用 javax。官网地址:https://github.com/hibernate/hibernate-orm

3.2 EclipseLink

3.0 反对 Jakarta JPA:jakarta.persistence.EntityManager。官网地址:https://github.com/eclipse-ee4j/eclipselink/releases

4. Bean Validation 标准(Jakarta EE9/JPA3.0):

4.1 Hibernate Validator

迁徙到 Jakarta EE 9 时,才倡议降级到 Hibernate Validator 7, 反对 Jakarta Bean Validation 3.0。官网地址:http://hibernate.org/validator/releases/7.0/

5. IOC/DI 标准(Jakarta EE8/2.0; Jakarta EE9/3.0):

5.1 HK2

jakarta 地址: https://github.com/eclipse-ee4j/glassfish-hk2, javax 地址:https://github.com/javaee/hk2

6. RESTful WebService(Jakarta EE8/2.1; Jakarta EE9/3.0):

6.1 Jersey

3.x 反对 Jakarta EE9. 2.x 及以前还是 javax. 官网地址: https://eclipse-ee4j.github.io/jersey/

6.2 Apache CXF(*)

目前只反对 javax. 官网地址: https://cxf.apache.org/

7. JMS 音讯服务(Jakarta EE8/2.0; Jakarta EE9/3.0):

7.1 ActiveMQ

目前只反对 jms 1.1 和 2.0. 官网地址: https://activemq.apache.org/

7.2 RocketMQ(*)

官网没查到反对 JMS 的具体版本 官网地址: http://rocketmq.apache.org/

8.JSON Processing(Jakarta EE8/1.1; Jakarta EE9/2.0); JSON Binding(Jakarta EE8/1.0; Jakarta EE9/2.0); XML Binding(Jakarta EE9/3.0)

8.1 Eclipse Yasson

Yasson is a Java framework which provides a standard binding layer between Java classes and JSON documents. This is similar to what JAXB is doing in the XML world. Yasson is an official reference implementation of JSON Binding (JSR-367).
官网地址:https://github.com/eclipse-ee4j/yasson

8.2 Apache Johnzon

Apache Johnzon is a Top Level Project at the Apache Software Foundation (ASF). It fully implements the JSON-P_1.1 (JSR-353) and JSON-B_1.0 (JSR-367) specifications.
Apache Johnzon is a project providing an implementation of JsonProcessing (aka JSR-353) and a set of useful extension for this specification like an Object mapper, some JAX-RS providers and a WebSocket module provides a basic integration with Java WebSocket API (JSR-356).
官网地址:https://johnzon.apache.org/

8.3 EclipseLink MOXy

Enables Java developers to efficiently bind Java classes to XML Schemas. MOXy implements JAXB allowing developers to provide their mapping information through annotations as well as providing support for storing the mappings in XML format. The many advanced mappings enable developers to handle the complex XML structures without having to mirror the schema in their Java class model.
官网地址:https://www.eclipse.org/eclipselink/

8.4 Jackson

https://github.com/FasterXML/jackson

8.5 Gson

https://github.com/google/gson

总结:

Jackson 和 Gson 并不是 jsr 标准的实现框架。Jackson 有个扩大:jackson-datatype-jsr353: support for JSON-P (“Java JSON API”) types (specifically its tree model objects)

正文完
 0