我创建的SpringBoot 项目使用的是最新的版本 3.5.0-SNAPSHOT, 但是我的 Maven 下载不了这个依赖。报错如下:
"G:\Program Files\jdk-17\jdk-17.0.12\bin\java.exe" -Dmaven.multiModuleProjectDirectory=G:\project\idea\workspace\websocket\messaging-stomp-websocket -Djansi.passthrough=true "-Dmaven.home=G:\Program Files\maven3.6.1" "-Dclassworlds.conf=G:\Program Files\maven3.6.1\bin\m2.conf" "-Dmaven.ext.class.path=G:\install\study\IntelliJ IDEA 2023.2\plugins\maven\lib\maven-event-listener.jar" "-javaagent:G:\install\study\IntelliJ IDEA 2023.2\lib\idea_rt.jar=56221:G:\install\study\IntelliJ IDEA 2023.2\bin" -Dfile.encoding=UTF-8 -classpath "G:\Program Files\maven3.6.1\boot\plexus-classworlds-2.6.0.jar" org.codehaus.classworlds.Launcher -Didea.version=2023.2 -s "G:\Program Files\maven3.6.1\conf\settings.xml" install
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.example:messaging-stomp-websocket:0.0.1-SNAPSHOT: Failure to find org.springframework.boot:spring-boot-starter-parent:pom:3.5.0-SNAPSHOT in http://repo.huaweicloud.com/repository/maven/ was cached in the local repository, resolution will not be reattempted until the update interval of huawecloud has elapsed or updates are forced and 'parent.relativePath' points at no local POM @ line 5, column 10
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.example:messaging-stomp-websocket:0.0.1-SNAPSHOT (G:\project\idea\workspace\websocket\messaging-stomp-websocket\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for com.example:messaging-stomp-websocket:0.0.1-SNAPSHOT: Failure to find org.springframework.boot:spring-boot-starter-parent:pom:3.5.0-SNAPSHOT in http://repo.huaweicloud.com/repository/maven/ was cached in the local repository, resolution will not be reattempted until the update interval of huawecloud has elapsed or updates are forced and 'parent.relativePath' points at no local POM @ line 5, column 10 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
Process finished with exit code 1
这个报错通常是由于依赖不存在或仓库配置问题引起的。通过检查依赖版本、强制更新或更改仓库配置,通常可以解决这个问题。
解决方法:
使用稳定版本:如果不需要快照版本,建议使用稳定版本(如 3.0.13),以避免类似问题