先创建基本maven项目
然后在pom.xml添加基本的jar配置
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.0</version>
<relativePath/>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
项目上就会有红叉
点击项目右击,找到Maven,在右侧有一个Update Project…,打开来
就会出现以下
选择你的项目
点击ok就行了,如果对你有用,给个赞呗!!!