spring boot 1.建立项目
程序员文章站
2022-07-04 18:48:38
...
1 建立Module项目
2 设置POM文件
设置parsent
a.设置parent为 spring-boot-starter-parent
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.7.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
3 确认并调整项目结构
|- src
|- main
|- java
|- resources
4 创建springboot启动类
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class MySpringBootApplication {
public static void main(String[] args) {
SpringApplication.run(MySpringBootApplication.class, args);
}
}
5 创建springboot配置文件
application.yml
上一篇: Java作业 第十二章