1.创建maven工程
idea +maven 搭建spring boot 项目点击next:

idea +maven 搭建spring boot 项目点击finish maven项目创建成功!
2.pom.xml文件配置
打开pom.xml并添加一下内容:

org.springframework.boot
spring-boot-starter-parent
2.3.0.RELEASE

3.添加 Classpath 依赖


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


idea +maven 搭建spring boot 项目
4.编写代码
创建启动类Application—名字自定义
idea +maven 搭建spring boot 项目
右键运行(8080为默认端口):
idea +maven 搭建spring boot 项目
测试:http://127.0.0.1:8080/home
idea +maven 搭建spring boot 项目
测试成功!!!

相关文章: