gpt4 book ai didi

java - 项目构建错误: Non-resolvable parent POM fo

转载 作者:行者123 更新时间:2023-12-01 16:45:17 32 4
gpt4 key购买 nike

这是我使用 Spring Boot 的第一个项目。所以我尝试使用父级更新 pom.xml,如下所示:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.in28minutes.springboot</groupId>
<artifactId>first-springboot-project</artifactId>
<version>0.0.1-SNAPSHOT</version>

<name>springboot-in-10-steps</name>
<description>Demo project for Spring Boot</description>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.BUILD-SNAPSHOT</version> <!-- lookup parent from repository -->
</parent>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
</project>

但是,我在行中遇到了错误:

Project build error: Non-resolvable parent POM for com.in28minutes.springboot:first-springboot-project:0.0.1-SNAPSHOT: Could not find artifact org.springframework.boot:spring-boot-starter-parent:pom:2.0.0.BUILD-SNAPSHOT and 'parent.relativePath' points at wrong local POM

请帮忙!

enter image description here

最佳答案

不存在 2.0.0-BUILD-SNAPSHOT 这样的东西,您可能是直接从 Spring Boot 项目复制的?

Spring Boot的发布版本可以在这里看到;

https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent

如果您想要最新版本,<version>2.0.6.RELEASE</version>会起作用的。

如果您想使用 SNAPSHOT 或 Milestone 版本,请参阅文档

https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/html/getting-started-installing-spring-boot.html#getting-started-maven-installation

指定所需的存储库。

关于java - 项目构建错误: Non-resolvable parent POM fo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53010860/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com