1.新建Maven项目
2.pom文件导入

org.springframework.boot
spring-boot-starter-parent
2.7.2

org.springframework.boot
spring-boot-starter-web

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-test</artifactId>
</dependency>

3.编写主启动类 @SpringBootApplication public class Application { public static void main(String[] args) { SpringApplication.run(Application.class,args); } } 4.编写主配置类