Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.2.6.RELEASE解决办
今天有新建项目后,提示如下错误:Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.2.6.RELEASE from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://r.
今天新建web项目后,提示如下错误:(建其他项目依然出现如下报错信息)
Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.2.6.RELEASE from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.2.6.RELEASE/spring-boot-starter-parent-2.2.6.RELEASE.pom
报错意思是无法去仓库https://repo.maven.apache.org/maven2下载https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.2.6.RELEASE/spring-boot-starter-parent-2.2.6.RELEASE.pom文件
解决办法:导入阿里镜像
<repositories>
<repository>
<id>aliyunmaven</id>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</repository>
</repositories>
然后出现了如下报错信息:
Cannot resolve plugin org.apache.maven.plugins:maven-site-plugin:3.8.2
该错误的意思是:不能解析maven的maven-site-plugin:3.8.2。
该错误的产生的原因和解决办法有以下几种:
1.下载过程中出现了网络或文件错误
这是最常见的错误,特别是没有配置Maven国内镜像的情况下,会有极大概率遇到这种情况。但我已导入了国内镜像。
解决办法:
针对这种情况可以执行CLEAN命令,然后重新install下载maven依赖。
2. IDEA的Maven环境配置错误
这种情况多半是IDEA配置的Maven依赖和POM文件添加的依赖不一致导致的。
解决办法:可以在plugin元素中去掉版本(version):如:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
~~<version>3.6.3</version>~~
</plugin>
</plugins>
</build>
我采用了第一种方法就解决了,感谢原文作者,原文出处链接:https://blog.csdn.net/u013840066/article/details/104024287
更多推荐
所有评论(0)