一天踩两次坑也是醉了~更新完spring boot的版本后居然部署不成功!查看日志报以下错
<pre class="console-output" style="box-sizing: inherit; font-size: var(--font-size-monospace); white-space: pre-wrap; overflow-wrap: break-word; margin: 0px; color: rgb(51, 51, 51); font-style: normal;
font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">
[FATAL] Non-resolvable parent POM for com.xxxx.xxxx:0.0.1-SNAPSHOT: Failure to transfer org.springframework.boot:spring-boot-starter-parent:pom:2.4.5 from [https://repo.maven.apache.org/maven2](https://repo.maven.apache.org/maven2) was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced.
Original error: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.4.5 from/to central ([https://repo.maven.apache.org/maven2](https://repo.maven.apache.org/maven2)): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.40.215] failed: Connection timed out (Connection timed out) and 'parent.relativePath' points at no local POM @ line 5, column 10
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:383)
at hudson.maven.MavenEmbedder.buildProjects(MavenEmbedder.java:370)
at hudson.maven.MavenEmbedder.readProjects(MavenEmbedder.java:340)
at hudson.maven.MavenModuleSetBuild$PomParser.invoke(MavenModuleSetBuild.java:1327)
at hudson.maven.MavenModuleSetBuild$PomParser.invoke(MavenModuleSetBuild.java:1124)
at hudson.FilePath.act(FilePath.java:1164)
at hudson.FilePath.act(FilePath.java:1147)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.parsePoms(MavenModuleSetBuild.java:985)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:689)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:513)
at hudson.model.Run.execute(Run.java:1907)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)</pre>
一开始以为是网络问题,还试了把jenkins更新,重装和更新jenkins的maven插件,升级maven,但后来发现都不是这些问题。
关键句是这个Failure to transfer org.springframework.boot:spring-boot-starter-parent:pom:2.4.5 from [https://repo.maven.apache.org/maven2](https://repo.maven.apache.org/maven2) was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced.
网上找到类似的解决方案:https://blog.51cto.com/qiangsh/1743074
于是直接跑到~/.m2/repository
路径下把spring-boot-starter-parent
目录全部删了~
网友评论