SpringBoot基础学习总结
今天学习了大周老师的SpringBoot基础教程,总结一下,以备后需。
1、引入Springboot需要的包。
如果在项目中,springboot只是一个moudle,那么在springboot模块的pom文件中,可能会存在两个partent的标记,这时可以将下方的parent放在最外层的pom文件中。
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.6.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependencies>
2、启动文件:Applicati