gpt4 book ai didi

spring - 项目构建错误:org.springframework.cloud:'spring-cloud-starter-eureka-server:jar缺少'dependencies.dependency.version'

转载 作者:行者123 更新时间:2023-12-04 03:19:00 24 4
gpt4 key购买 nike

我正在从https://www.dineshonjava.com/microservices-with-spring-boot/开发代码。当我将spring-boot-starter-parent从1.5.4.RELEASE更新为2.0.4.RELEASE时,构建失败。

谁能指导我这是什么问题?


项目构建错误:org.springframework.cloud:'spring-cloud-starter-eureka-server:jar缺少'dependencies.dependency.version'。


另一个错误:

Multiple annotations found at this line:
- For artifact {org.springframework.cloud:spring-cloud-starter-eureka-server:null:jar}: The version cannot be empty. (org.apache.maven.plugins:maven-resources-plugin:3.0.2:resources:default-resources:process-
resources) org.apache.maven.artifact.InvalidArtifactRTException: For artifact {org.springframework.cloud:spring-cloud-starter-eureka-server:null:jar}: The version cannot be empty. at
org.apache.maven.artifact.DefaultArtifact.validateIdentity(DefaultArtifact.java:148) at org.apache.maven.artifact.DefaultArtifact.<init>(DefaultArtifact.java:123) at
org.apache.maven.artifact.factory.DefaultArtifactFactory.createArtifact(DefaultArtifactFactory.java:157) at org.apache.maven.artifact.factory.DefaultArtifactFactory.createDependencyArtifact(DefaultArtifactFactory.java:
57) at org.apache.maven.project.artifact.MavenMetadataSource.createDependencyArtifact(MavenMetadataSource.java:328) at
org.apache.maven.project.artifact.MavenMetadataSource.createArtifacts(MavenMetadataSource.java:503) at


pom.xml

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter</artifactId>
</dependency>
<!-- Eureka registration server -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<!-- <version>Camden.SR5</version> -->
<version>Finchley.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

最佳答案

如我的评论所示,一些入门者已重命名:https://github.com/spring-projects/spring-cloud/wiki/Spring-Cloud-Edgware-Release-Notes


许多入门者未遵循正常的Spring Cloud命名约定。在Edgware中,使用不建议使用的启动程序将记录一个警告,并在该警告中使用要使用的新启动程序的名称。


所以改变:
spring-cloud-starter-eureka-server
spring-cloud-starter-netflix-eureka-server

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

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