我正在从https://www.dineshonjava.com/microservices-with-spring- boot/开发代码。当我从更新的春天开机起动亲1.5.4.RELEASE到2.0.4.RELEASE,构建得到了失败。
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-cloud-starter-eureka-server
spring-cloud-starter-netflix- eureka-server