I. Description of the problem
- It is wrong when I create a spring-boot program that appears when you configure pox
Project build error: Non-resolvable parent POM for com.example:spring-boot:0.0.1-SNAPSHOT:
Failure to transfer org.springframework.boot:spring-boot-starter-parent:pom:2.2.2.RELEASE from http://repo2.maven.org/maven2/ was cached in the local repository, resolution will not be reattempted until the update interval of repo2 has elapsed or updates are forced. Original error:
Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.2.2.RELEASE from/to repo2 (http://repo2.maven.org/maven2/): repo2.maven.org and 'parent.relativePath' points at no local POM
- The main two errors:
Non-resolvable parent POM for com.example:spring-boot:0.0.1-SNAPSHOT
repo2.maven.org and 'parent.relativePath' points at no local POM
Second, the problem is solved
- The reason is that the project can not find your pox file corresponds to version dependencies
- This is my pox Code, the problem:
<version>2.2.2.RELEASE</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
1, a way
The Internet is more common, it is to update maven local repository, my purpose is not to write him
2. Second way
A way may not solve your problem, if not the first time you use maven, you can use this method
- Depending on your pom file dependencies, locate the file in your local repository
<groupId>org.springframework.boot</groupId>
<version>2.2.2.RELEASE</version>
- The two package files appear in FIG red box, it can be used
It is not used
- The pom file version into the existing version of the local
2. Three ways
Adapt the central warehouse bin through local address configuration, Since you can successfully updated
<!-- 阿里镜像 -->
<mirrors>
<mirror>
<id>nexus-aliyun</id>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<!-- ibiblio镜像 -->
<mirror>
<id>ibiblio</id>
<name>Mirror from Maven ibiblio</name>
<url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<!-- 开源中国镜像 -->
<id>CN</id>
<name>OSChina Central</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
- After a good pom file editing, saving, local repository is automatically updated