在IntelliJ idea中搭建SpringBoot项目

1.打开IntelliJ idea,File—New—Project,左侧选择Spring Initializr,Project SDK中选择jdk安装目录,其中Service URL是Spring官方提供的Spring Initializr工具的地址

在IntelliJ idea中搭建SpringBoot项目

2.点击Next,填写项目信息,其中,Goup和Artifact都属于项目的id,保证项目的唯一性,添加maven仓库时,根据这两个值能找到唯一项目。

GroupId第一段为域, 可以为cn(china),org(非营利组织),com(商业组织),第二段为组织,可以写公司名、平台名或个人名;

ArtifactId写项目名称

在IntelliJ idea中搭建SpringBoot项目

3.点击Next,如下所示,可以配置自己需要的依赖,右上角的Spring Boot是当前的SpringBoot版本,可以根据需要选择

在IntelliJ idea中搭建SpringBoot项目

4.配置完依赖和版本后,点击Next,设置项目存储位置

在IntelliJ idea中搭建SpringBoot项目

设置完项目名和存储位置,点击Finish

5.我创建的项目中,resources目录默认为Sources Root,这时需要右键Mark Directory as—Resources Root

在IntelliJ idea中搭建SpringBoot项目

在IntelliJ idea中搭建SpringBoot项目

6.启动项目,可以看到SpringBoot启动标志

在IntelliJ idea中搭建SpringBoot项目

SpringBoot项目搭建完成!