Jakarta EE 2020戰果總結

從Eclipse基金接過java EE的接力棒已有兩年多了,因爲Oracle拒絕交出javax名稱空間的使用權, Eclipse基金只能新建一個名稱空間Jakarta. 從官方的規範來看仍是戰果累累。Eclipse基金如今完成了Jakarta8,9的release。其關聯社區(Redhat,JBoss)的好多框架都完成了過分php

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 應用服務器

image

1. Tomcat

從Tomcat的官網上看10是使用Jakarta EE,目前還處於beta. 9是javax的版本. 官方地址:java

2. Jetty

Eclipse基金自已的Servlet容器。因此已經完成過分。jetty 11 使用Jakarta EE已經release. jetty 10是javax的版本。 官方地址: https://www.eclipse.org/jetty/download.phpgit

3. Undertow

Jboss社區開發的Servlet容器,網上流傳的是性能目前來看最好的一個。這也是SpringBoot支持的內置容器。從github上發佈的版原本看已有Jakarta EE的多個版本。官方地址: https://github.com/undertow-io/undertowgithub

4. GlassFish

開發維護的權力交給了Eclipse基金。這是EE標準的實現參考。javax能用的最後一個版本是:5.0。Jakarta EE已經有多個版本release。官方地址: https://javaee.github.io/glassfish/web

5. WildFly

原名JBoss. 如今是紅帽子基金旗下的EE 應用服務器。內置的Servlet容器是Undertow,javax能用的最後一個版本是:20.0.1.Final。Jakarta EE已經有多個版本release。官方地址: https://www.wildfly.org/downloads/spring

6. WebLogic(*)

這是Oracle旗下的EE應用服務器。Jakarta EE 8 的release版本:14.1.1.0(https://jakarta.ee/compatibility/download/)。apache

7. WebSphere(*)

這是IBM旗下的EE應用服務器。Jakarta EE 8 的release版本:20.0.0.3(https://jakarta.ee/compatibility/download/)segmentfault

總結:

從Servlet容器和應用服務器來看. Jakarta EE的生態已趨完整。但開發項目除了佈署的容器和服務器還要看應用框架.api

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):

image

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)

image

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)

相關文章
相關標籤/搜索