Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How springboot modifies the built-in tomcat version

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to modify the built-in tomcat version of springboot. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

1. Resolve the Spring Boot parent dependency

Org.springframework.boot spring-boot-starter-parent 1.5.6.RELEASE

This configuration is the Spring Boot parent dependency, with this, the current project is the Spring Boot project, spring-boot-starter-parent is a special starter, it is used to provide the relevant Maven default dependency, after using it, the commonly used package dependency can omit the version tag. For dependencies on which jar packages are provided by Spring Boot, see C:\ Users\ user .m2\ repository\ org\ springframework\ boot\ spring-boot-dependencies\ 1.5.1.RELEASE\ spring-boot-dependencies-1.5.1.RELEASE.pom

2. Open the pom file and search "tomcat.version" to find: 8.5.16

① can modify the tomcat version you want directly here.

② adds a version to the pom of your own project and you can directly overwrite the version here. Such as:

Tomcat version configuration code in Pom

8.0.29

After adding this, the default startup tomcat version of spingboot will be as good as you need. It's almost done here.

But sometimes the startup will report an error:

Tomcat startup error code

Caused by: java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory at org.apache.catalina.util.LifecycleBase. (LifecycleBase.java:37) at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer (TomcatEmbeddedServletContainerFactory.java:169) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer (EmbeddedWebApplicationContext.java:164) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh (EmbeddedWebApplicationContext.java:134)... 13 common frames omitted

Because the tocmat at this time lacks the jar package, it would be nice to add the following dependency to the maven project:

Org.apache.tomcat tomcat-juli ${tomcat.version} this is the end of the article on "how to modify the built-in tomcat version of springboot". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report