创建springboot项目方法三:
通过创建Meven
工程来创建SpringBoot项目
-
file—new—project
-
maven—jdk(无需选择骨架)
-
填写项目路径项目名称等信息
-
此时maven工程就创建好啦
-
创建springboot 项目啊
-
引入依赖坐标 ,父工程
<!-- 父工程 -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.3</version>
</parent>
- 再添加 web依赖
<!-- 添加依赖 -->
<dependencies>
<!-- web 依赖关系 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
-
然后在项目中添加 启动类
-
启动运行测试