使用新版idea后,创建springboot项目会有点区别。无需选定Web,Mysql和Thymeleaf(本文第4部操作)。前提是在项目中会配置,在springboot中的pom.xml中添加以下三个,如图
<!-- 引入前端web,此注解不存在Controller层注解会报一系列错误 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- 引入mysql依赖,解决application-dev.xml中驱动driver-class-name无法加载问题 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.13</version>
</dependency>
<!-- 添加持久层的jar包 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
1、打开idea,点击Create New Project