SpringBoot项目启动时,log如下:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.3.2.RELEASE)
2021-01-08 14:02:04.079 INFO 35632 --- [ main] com.demo.MybatisDemoApplication : Starting MybatisDemoApplication on bogon with PID 35632 (/Users/tianpengfei/pftian/pftian-git/springboot-mybatis-demo/target/classes started by tianpengfei in /Users/tianpengfei/pftian/pftian-git/springboot-mybatis-demo)
2021-01-08 14:02:04.081 DEBUG 35632 --- [ main] com.demo.MybatisDemoApplication : Running with Spring Boot v2.3.2.RELEASE, Spring v5.2.8.RELEASE
2021-01-08 14:02:04.081 INFO 35632 --- [ main] com.demo.MybatisDemoApplication : No active profile set, falling back to default profiles: default
2021-01-08 14:02:04.371 WARN 35632 --- [ main] o.m.s.mapper.ClassPathMapperScanner : No MyBatis mapper was found in '[com.demo]' package. Please check your configuration.
2021-01-08 14:02:04.511 INFO 35632 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2021-01-08 14:02:04.625 INFO 35632 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
_ _ |_ _ _|_. ___ _ | _
| | |\/|_)(_| | |_\ |_)||_|_\
/ |
3.4.1
2021-01-08 14:02:04.768 INFO 35632 --- [ main] com.demo.MybatisDemoApplication : Started MybatisDemoApplication in 0.921 seconds (JVM running for 1.282)
2021-01-08 14:02:04.771 INFO 35632 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2021-01-08 14:02:04.772 INFO 35632 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
解决方法:
加入如下依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>