问题描述:
才刚新建的工程,什么都没做,就显示pom.xml有问题,在第一行的标签上 有如下错误:
点击详情:
Failure to transfer org.apache.maven:maven-parent:pom:20 from http://repo.maven.apache.org/maven2was 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.apache.maven:maven-parent:pom: 20 from/to central (http://repo.maven.apache.org/maven2): null to http://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/20/maven-parent-20.pom
百度了之后知道这个是更新问题(之前忘了设置maven在eclipse的配置,后来设置完了之后还是有错误):
三步:
(1)右键点击该project,选择 run as-》maven clean
(2)右键点击该project,选择 run as-》maven install
(3)右键点击该project,选择 maven-》update project
然后就可以看到错误消失了,如果没有消失,点击restart eclispe即可。
时间: 2024-11-10 14:43:21