<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <!--spring boot 内置了tomcat,所以我们没有tomcat也可以直接通过jar运行,如果想通过常规的war来部署就在这里移除tomcat就可以了--><!-- <exclusion> <artifactId>spring-boot-starter-tomcat</artifactId> <groupId>org.springframework.boot</groupId> </exclusion>--> <!--spring boot 内置的日志是slf4j与logback,如果想用log4j就移除,并添加相应依赖就可以了--> <exclusion> <artifactId>spring-boot-starter-logging</artifactId> <groupId>org.springframework.boot</groupId> </exclusion> </exclusions> </dependency>