idea创建springboot项目并启动 / 超详细步骤

前言

刚刚接触到IDEA,创建springboot总出现各种问题,下面记录一下成功的创建过程。作者纯小白,所以这个创建过程可能存在可以精简的部分,仅希望给看到的人提供一点修改的思路。

具体过程

首先new一个Project
idea创建springboot项目并启动 / 超详细步骤
不用修改直接Next
idea创建springboot项目并启动 / 超详细步骤
根据需要进行修改,也可以直接Next
idea创建springboot项目并启动 / 超详细步骤
这里以Spring Web为例,然后Next,完成创建。
idea创建springboot项目并启动 / 超详细步骤
创建好的项目,看了不少教程,但发现一些人创建之后的文件结构和我这里不同。可以看到这里是没有启动程序的小三角的。
idea创建springboot项目并启动 / 超详细步骤
接下来的步骤就是为了出现启动的小三角,首先点击File选择Project Structure
idea创建springboot项目并启动 / 超详细步骤
点击Modules然后点击+号
idea创建springboot项目并启动 / 超详细步骤
选择Import Module
idea创建springboot项目并启动 / 超详细步骤
找到我们本项目的pom.xml文件,然后选择OK,然后点击apply,就完成了。
idea创建springboot项目并启动 / 超详细步骤
现在就出现了启动的小三角,但是SpringBootApplication一片飘红。
idea创建springboot项目并启动 / 超详细步骤
选择File->setting
idea创建springboot项目并启动 / 超详细步骤
将下面三个修改为我们本地的,然后Apply,再点击OK
idea创建springboot项目并启动 / 超详细步骤
然后File->Invalidate Caches…,选择just Restar
idea创建springboot项目并启动 / 超详细步骤
再选择Import Changes,就完成了
idea创建springboot项目并启动 / 超详细步骤
完成创建
idea创建springboot项目并启动 / 超详细步骤