如何查看Spring boot中tomcat的版本信息

这篇文章主要介绍“如何查看Spring boot中tomcat的版本信息”,在日常操作中,相信很多人在如何查看Spring boot中tomcat的版本信息问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”如何查看Spring boot中tomcat的版本信息”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

查看当前使用的Tomcat版本号

Maven Repository中查看

比如我们需要查看Spring Boot2.0.6.RELEASE的内嵌的Tomcat版本,可以打开链接

https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-tomcat/2.0.6.RELEASE

如下图,红框标记的就是tomcat版本号:

如何查看Spring boot中tomcat的版本信息

指定Spring Boot项目内嵌的Tomcat版本

Maven的配置

在pom.xml文件里面添加一个标签<properties>,添加期望的版本

<tomcat.version>8.5.34</tomcat.version>

添加必要的Jar包:

<dependency> 
   <groupid>org.apache.tomcat</groupid> 
   <artifactid>tomcat-juli</artifactid> 
   <version>${tomcat.version}</version> 
 </dependency>
<dependency>
    <groupid>org.apache.tomcat.embed</groupid>
    <artifactid>tomcat-embed-logging-juli</artifactid>
    <version>${tomcat.version}</version>
</dependency>

到此,关于“如何查看Spring boot中tomcat的版本信息”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注网站,小编会继续努力为大家带来更多实用的文章!