前端时间还能跑的springboot项目,什么配置也没改,今天突然发现这样了。Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.1.4.RELEASE from/to mirrorId (http://repo1.maven.org/maven2/): Failed to transfer file http://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.1.4.RELEASE/spring-boot-starter-parent-2.1.4.RELEASE.pom with status code 501
报错截图1
The build could not read 1 project -> [Help 1]
The project com.lockers.home:lockers:1.0-SNAPSHOT (H:\XiangMu\lockers\pom.xml) has 1 error
Non-resolvable parent POM for com.lockers.home:lockers:1.0-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.1.4.RELEASE from/to mirrorId (http://repo1.maven.org/maven2/): Failed to transfer file http://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.1.4.RELEASE/spring-boot-starter-parent-2.1.4.RELEASE.pom with status code 501 and ‘parent.relativePath’ points at no local POM @ line 12, column 13 -> [Help 2]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
报错截图2
报错3
repo1.maven.org:80 [repo1.maven.org/151.101.40.209] failed: Connection timed
原因及解决方案
Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.1.4.RELEASE from/to mirrorId (http://repo1.maven.org/maven2/): Failed to transfer file http://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.1.4.RELEASE/spring-boot-starter-parent-2.1.4.RELEASE.pom with status code 501
这个是根本的报错原因
http://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.1.4.RELEASE/spring-boot-starter-parent-2.1.4.RELEASE.pom
这个镜像现在无法在maven的仓库访问了
用阿里云的镜像就没关系了,我前段时间修改配置文件镜像的时候,把maven仓库的镜像放在了首位,所以产生了如下的先去maven中央仓库找镜像的问题。