1、创建一个MAVEN工程(Java项目)
2、配置信息
2.1、项目中引入springboot依赖
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.2</version>
<relativePath/>
</parent>
2.2、引入springBoot的 web支持
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>

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

4、创建包并创建控制器

@Controller
@RequestMapping("/zhl")
public class UserController {
@RequestMapping("/hello")
public String hello(){
System.out.println("启动成功!");
return "success";
}
}
5、打包

6、启动