Jakarta EE 2020战果总结

  • Post author:
  • Post category:其他


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



版权声明:本文为xiaofanku原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。