首先新建一个spring工程 选择Spring Boot DevTools、Spring Web、Thymeleaf、Spring Data JPA和MySQL Driver等配置工具。
然后新建application.yml配置文件
spring:
thymeleaf:
mode: HTML5
datasource:
url: jdbc:mysql://localhost:3306/whlg01?serverTimezone=Asia/Shanghai&characterEncoding=utf-8
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: 123456
jpa:
hibernate:
ddl-auto: update
show-sql: true
server:
port: 8080
logging:
level:
root: info
file:
path: log/blog
这样,一个SpringBoot项目就快速搭建好了,比之前SSM和配置SpringBoot的方法要简单快捷的多。