在对Spring cloud spring-server进行打包时,maven clean 时出现了以下错误
Plugin org.springframework.boot:spring-boot-maven-plugin:2.0.0.M3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.springframework.boot:spring-boot-maven-plugin:jar:2.0.0.M3: Failure to find io.projectreactor:reactor-bom:pom:Bismuth-M3 in http://maven.aliyun.com/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of alimaven has elapsed or updates are forced
经过分析,这个错误的重点在于以下三点
1.spring-boot-maven-plugin:2.0.0.M3 or one of its dependencies could not be resolved
2.Failure to find io.projectreactor:reactor-bom:pom:Bismuth-M3
3.http://maven.aliyun.com/nexus/content/groups/public/ was cached in the local repository
首先,根据错误后面的 or updates are forced 进行第一次解决尝试
maven update-project
结果失败。
然后,根据第一点的问题,经过分析,可能是由于 plugin 2.0.0.M3 jar包无法读取到
尝试找到本地仓库的spring-boot-maven-plugin:2.0.0.M3 ,发现.jar文件是完整存在的。当时想到有可能是jar不完整,所以删掉了整个目录,重新下载。发现依旧无法解决。
这时排除了第一个问题。然后进行第三个问题的排除。阿里云镜像出错?
修改了maven settings文件,把阿里与改为maven中央库,依旧无法解决,甚至连plugin jar都无法下载到。
经过一系列的排错,把目标定位在了pom:Bismuth-M3 这个东西上。谷歌了一下关键字。终于发现了一个正确解决方案
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>