可能会出现几种报错:
- ideaCannot download sources Sources not found for: org.springframework:spring-beans:5.2.10.REL
- Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:resolve (default-cli):
解决方法:找到你项目的pom文件
我本来新建完项目是这样的
对比后发现是因为缺少了一些配置,自行添加就好,也可以拷贝我的这份,这里的跟你pom文件开头用的保持一致
<build>
<finalName>spring-demos</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
</configuration>
<version>2.2.11.RELEASE</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>