当我尝试创建 Spring Boot 文件时收到一条错误消息,它给了我一个特定的错误代码。
Project build error: Non-resolvable parent POM for com.example:demo:0.0.1-SNAPSHOT: The following artifacts could not be resolved: org.springframework.boot:spring-boot-starter-parent:pom:3.2.3 (absent): org.springframework.boot:spring-boot-starter-parent:pom:3.2.3 failed to transfer from https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not 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:3.2.3 from/to central (https://repo.maven.apache.org/maven2): No such host is known (repo.maven.apache.org) and 'parent.relativePath' points at no local POM
当我查看 pom.xml 文件时,它在这一行显示错误。
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.3</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
我尝试通过不同的互联网连接进行连接,甚至尝试更改不同版本的 Java 和 Spring boot。
从命令行运行
mvn install
时是否出现错误?还是通过IDE?
我在使用 IDE 时遇到过类似的情况,这是该 IDE 中的一个错误。