How to change the version of Spring boot’s embedded Tomcat
To check the Tomcat version of Spring boot 2.1.1, you can check the Tomcat startup log.
2019-01-07 21:56:56.097 INFO 16344 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2019-01-07 21:56:56.122 INFO 16344 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2019-01-07 21:56:56.122 INFO 16344 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/9.0.13
We confirmed the following environment
Spring boot | Tomcat |
---|---|
2.1.1 | 9.0.13 |
To change only the embedded Tomcat version in this environment, specify the version in pom.xml.
<properties> <java.version>1.8</java.version> <tomcat.version>8.5.34</tomcat.version> </properties>
You can change it in tomcat.version as above.
Spring boot | Tomcat |
---|---|
2.1.1 | 8.5.34 |
If you change the Tomcat version to 8.5.34 and start the embedded Tomcat, you will see that the log version has changed to 8.5.34.
2019-01-07 22:16:56.552 INFO 17160 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2019-01-07 22:16:56.578 INFO 17160 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2019-01-07 22:16:56.579 INFO 17160 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.34
コメント