1、File—>New—Maven Project,选择Create a simple project,点击next
2、输入Group Id,Artifact Id,Packaging选择pom,点击Finish
3、父工程创建完成后,修改父pom文件,加入SpringCloud依赖
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.landcode</groupId> <artifactId>land</artifactId> <version>1.0.0-SNAPSHOT</version> <packaging>pom</packaging> <properties> <spring-cloud.version>Greenwich.SR2</spring-cloud.version> <spring-boot.version>2.1.6.RELEASE</spring-boot.version> <gson.version>2.6</gson.version> </properties> <!-- spring-cloud所有项目依赖包 --> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId>