如何在现有的Spring Boot应用程序中更改嵌入式tomcat的版本? [英] How to change embedded tomcat's version in existing spring boot app?
问题描述
我当前正在运行具有嵌入式tomcat的spring-boot version 1.4.0.RELEASE
应用程序.包含的Tomcat版本是8.5.4
I'm currently running spring-boot version 1.4.0.RELEASE
application with embedded tomcat. Included Tomcat's version is 8.5.4
需要将tomcat版本更新为9.x
.当我查看mvnrepository时此处,我发现tomcat版本9.0.5
有可用更新(如下图所示)
There's a need to update the tomcat version to 9.x
. When I looked at mvnrepository here, I found that there's an update available to tomcat version 9.0.5
(shown in pic below)
如果无法在我的pom.xml
中直接提及此版本,该如何在我的项目中使用该版本?
How should I use this version in my project if there's no way to directly mention this version in my pom.xml
?
我不想走传统的部署路线(外部雄猫上的WAR工件).
I do not want to go the traditional deployment route (WAR artifacts on external tomcats).
推荐答案
如果您正在使用spring boot gradle插件和spring boot starters ..您可以通过在build.gradle中设置maven项目属性来自定义版本.
If you are using spring boot gradle plugin and spring boot starters ..you can customise the version by setting maven project properties in build.gradle.
ext['tomcat.version'] = '8.5.34'
您可以在 查看全文