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

前端 未结 9 1859
既然无缘
既然无缘 2021-02-19 03:01

I am developing a code from https://www.dineshonjava.com/microservices-with-spring-boot/. When I update the spring-boot-starter-parent from 1.5.4.RELEASE to 2

相关标签:
9条回答
  • 2021-02-19 03:37

    Even I got the similar error when I was adding dependency for hystrix.

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

    It worked after changing netflix <artifactId>

    from: spring-cloud-starter-hystrix 
    to:   spring-cloud-starter-netflix-hystrix
    
    0 讨论(0)
  • 2021-02-19 03:44

    Add the following int the Pom.xml

    <properties>
            <java.version>1.8</java.version>
             <spring-cloud.version>Greenwich.RELEASE</spring-cloud.version>
     </properties>
    
    <dependencies>
    <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-webflux</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
            </dependency>
    
        </dependencies>
    
        <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>
    
    0 讨论(0)
  • 2021-02-19 03:44

    1º) remove dependency from your pom.xml and save the file;

    2º) Go to the STS project > right click > Spring > Edit Starters > search to Eureka Discovery Client and mark checkbok > OK.

    This action solved my problem.

    0 讨论(0)
  • 2021-02-19 03:45

    As indicated in my comment, some starters were renamed: https://github.com/spring-projects/spring-cloud/wiki/Spring-Cloud-Edgware-Release-Notes

    A number of starters did not follow normal Spring Cloud naming conventions. In Edgware, use of the deprecated starter will log a warning with the name of the new starter to use in its place.

    So change: spring-cloud-starter-eureka-server to spring-cloud-starter-netflix-eureka-server.

    0 讨论(0)
  • 2021-02-19 03:45

    After setting the version:

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        <version>3.0.0</version>
    </dependency>
    

    the error disappeared. Probably not the best solution for production.

    0 讨论(0)
  • 2021-02-19 03:51

    There are a couple of things here. I was trying to create the Eureka server and I faced a couple of problems.

    First things

    If you are using spring-cloud-starter-eureka-server then change it to spring-cloud-starter-netflix-eureka-server.

    The link will give the details of the changes. https://github.com/spring-projects/spring-cloud/wiki/Spring-Cloud-Edgware-Release-Notes

    I recently created the starter project from https://start.spring.io/ and it has the latest changes in pom.xml

    This is how it looks like

    <dependency>
     <groupId>org.springframework.cloud</groupId>
     <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
    </dependency>
    
    <dependency>
     <groupId>org.springframework.cloud</groupId>
     <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
    </dependency>

    You need to make sure that the eureka server dependency version is correct. You can make sure by adding <spring-cloud.version>Greenwich.RELEASE</spring-cloud.version> in properties tag and ${spring-cloud.version} in dependencyManagement's version tag

    If you do not see the <dependencyManagement> tag then add the whole dependency in your pom.xml

    <properties>
        <java.version>1.8</java.version>
         <spring-cloud.version>Greenwich.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>

    I hope it helps.

    0 讨论(0)
提交回复
热议问题