首先打开 IDEA 并点击 New Project,进入如下页面,点击 Maven,选中"Create from archetype" big选择 quickstart 然后 next
GroupId 为 package 名,ArtifactId 为项目名称,点击 next
不用改动,直接 next(有教程说要添加一个什么东西来防止下载速度过慢,笔者用了另一种办法,后面描述)
上一步也可以选择在properties里加入 archetypeCatalog=internal
这个页面也不用改动,直接 finish
进入项目后,先去修改 pom.xml 文件,首先添加图中圈出的三处(version 请视自己具体所用版本而定)
接着在 <dependencies> </dependencies> 标签内添加以下配置
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<version>2.0.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>