70.16.1 通过Maven使用Tomcat 7.x或8.0

如果正在使用starters 和parent,你只需要改变Tomcat的version属性,并添加tomcat-juli依赖。比如,对于一个简单的webapp或service:

  1. <properties>
  2. <tomcat.version>7.0.59</tomcat.version>
  3. </properties>
  4. <dependencies>
  5. ...
  6. <dependency>
  7. <groupId>org.springframework.boot</groupId>
  8. <artifactId>spring-boot-starter-web</artifactId>
  9. </dependency>
  10. <dependency>
  11. <groupId>org.apache.tomcat</groupId>
  12. <artifactId>tomcat-juli</artifactId>
  13. <version>${tomcat.version}</version>
  14. </dependency>
  15. ...
  16. </dependencies>