一、创建工程
使用IDE创建新的项目,选择Maven项目,这里不适用骨架
点击Next,输入GroupId与ArtifactId
点击Next,输入项目名和项目存放路径名,然后就点击finish创建完成。
二、编辑pom.xml
首先指定父级依赖,将如下配置添加到project标签中
<!--指定父级依赖 所有springboot项目都必须继承spring-boot-starter-parent-->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<!--SpringBoot版本-->
<version>2.0.1.RELEASE</version>
</parent>
然后添加spring-web启动器依赖到dependencies标签中,没有该标签的在project标签下添加一个即可
<dependencies>
<!--web功能的起步-->
<dependency>