使用eclipse插件sts搭建springboot项目遇到pom.xml文件中的<parent>标签报错提示:
Project build error: Non-resolvable parent POM for com.example:demo:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.2.6.RELEASE from/to mirrorId (http://central.maven.org/maven2/): central.maven.org an
解决办法:
1:先清空maven仓库中的内容
2:在maven的conf文件夹中的settings.xml文件中的mirrors标签中加入下面内容
3:在项目中右键选择maven==》update project ,选中Force Update of Snap...选项,等待一段时间(需要下载相关文件)
<mirrors>
<mirror>
<id>repo2</id>
<mirrorOf>central</mirrorOf>
<name>spring2.0 for this Mirror.</name>
<url>https://repo.spring.io/libs-milestone</url>
</mirror>
<mirror>
<id>net-cn</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://maven.net.cn/content/groups/public/</url>
</mirror>
<mirror>
<id>ui</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://uk.maven.org/maven2/</url>
</mirror>
<mirror>
<id>ibiblio</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
</mirror>
<mirror>
<id>jboss-public-repository-group</id>
<mirrorOf>central</mirrorOf>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public</url>
</mirror>
</mirrors>