gpt4 book ai didi

spring-cloud - 项目构建错误: 'dependencies.dependency.version' for org. springframework.cloud:spring-cloud-starter-config:jar is missing

转载 作者:行者123 更新时间:2023-12-05 04:02:39 32 4
gpt4 key购买 nike

我正在从链接开发代码:https://howtodoinjava.com/spring-cloud/spring-cloud-config-server-git/当我更新 Spring Boot 版本 2.1.2.RELEASE pom.xml 时,出现以下错误。

Project build error: 'dependencies.dependency.version' for org.springframework.cloud:spring-cloud-starter-config:jar is missing.

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>

最佳答案

最好的方法是添加一个属性来定义所有 spring-cloud 依赖项的版本,如下所示:

<properties>
...
<spring-cloud.version>Hoxton.RELEASE</spring-cloud.version>
</properties>

然后添加这个依赖管理:

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

关于spring-cloud - 项目构建错误: 'dependencies.dependency.version' for org. springframework.cloud:spring-cloud-starter-config:jar is missing,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54257355/

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