10升级介绍

Tomcat10 修补了之前版本的漏洞,主要是x的漏洞,导致使用javax jar包的项目不能直接部署,需要使用官方工具转换。

Tomcat9及以下升级Tomcat10 部署操作

官网提供转换程序
https://github.com/apache/tomcat-jakartaee-migration

Apache官方说明:Users of Tomcat 10 onwards should be aware that, as a result of the move from Java EE to Jakarta EE as part of the transfer of Java EE to the Eclipse Foundation, the primary package for all implemented APIs has changed from javax.* to jakarta.*. This will almost certainly require code changes to enable lications to migrate from Tomcat 9 and earlier to Tomcat 10 and later. A migration tool has been developed to aid this process.

大意是:由于Java EE 改为 Jakarta EE,javax. 的包全都换成 jakarta.。Tomcat9以及之前的版本需要使用工具来转换一下。

转换步骤

  1. 使用上边提供地址下载项目并导入,运行mvn compile package,生成jar包;
  2. 或者直接运行jar包:本人打包后的jar下载地址 :https://download.csdn.net/download/linzi19900517/34210765
java -jar jakartaee-migration-版本号-shaded.jar D:源路径demo.war D:目标路径newdemo.war

 


3.将新war包放入tomcat启动即可。

胜象大百科