springboot导入parent父工程失败/Cannot resolve plugin org.apache.maven.plugins:maven-site-plugin

springboot导入parent父工程过程中,出现两个问题:

springboot导入parent父工程失败/Cannot resolve plugin org.apache.maven.plugins:maven-site-plugin
(1、org.springframework.boot 和spring-boot-starter-parent 标红
下载插件失败 报错:
Cannot resolve plugin org.apache.maven.plugins:maven-site-plugin
(2、红色框内为红色,报错。

更换过version版本号都不起作用,终于在一篇文章发现解决方法


解决方法

修改 maven中setting.xml 文件中的镜像源,寻找标签如图
springboot导入parent父工程失败/Cannot resolve plugin org.apache.maven.plugins:maven-site-plugin
将以下代码添加到标签内部:

<!-- 阿里镜像 -->
<mirror>
    <id>alimaven</id>
    <mirrorOf>central</mirrorOf>
    <name>aliyun maven</name>
    <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
<mirror>
    <id>alimaven</id>
    <name>aliyun maven</name>
    <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
    <mirrorOf>central</mirrorOf>
</mirror>
<mirror>
    <id>central</id>
    <name>Maven Repository Switchboard</name>
    <url>http://repo1.maven.org/maven2/</url>
    <mirrorOf>central</mirrorOf>
</mirror>
<mirror>
    <id>repo2</id>
    <mirrorOf>central</mirrorOf>
    <name>Human Readable Name for this Mirror.</name>
    <url>http://repo2.maven.org/maven2/</url>
</mirror>
<mirror>
    <id>ibiblio</id>
    <mirrorOf>central</mirrorOf>
    <name>Human Readable Name for this Mirror.</name>
    <url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
</mirror>
<mirror>
    <id>jboss-public-repository-group</id>
    <mirrorOf>central</mirrorOf>
    <name>JBoss Public Repository Group</name>
    <url>http://repository.jboss.org/nexus/content/groups/public</url>
</mirror>
<mirror>
    <id>google-maven-central</id>
    <name>Google Maven Central</name>
    <url>https://maven-central.storage.googleapis.com
    </url>
    <mirrorOf>central</mirrorOf>
</mirror>
<!-- *仓库在中国的镜像 -->
<mirror>
    <id>maven.net.cn</id>
    <name>oneof the central mirrors in china</name>
    <url>http://maven.net.cn/content/groups/public/</url>
    <mirrorOf>central</mirrorOf>
</mirror>

保存退出,重新开启一个项目,点击右上角图标进行reload maven projects,如图,发现报错没了
springboot导入parent父工程失败/Cannot resolve plugin org.apache.maven.plugins:maven-site-plugin

参考文章:
link.

上一篇:交叉编译libusb配置configure时出错


下一篇:ASP.NET Core应用基本编程模式[5]:如何放置你的初始化代码