springCloud 做 Eureka客戶端時 @EnableEurekaClient 一直無法引入
阿新 • • 發佈:2019-01-02
在用springCloud Eureka做服務端的時候發現這個一直引不了包
結果是用了高版本的Eureka卻引入了較低 版本Camden系列 的 cloud依賴包
這是低版本的cloud Eureka依賴
改為如下圖Finchley.RELEASE 版本的依賴
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.RELEASE</version>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Finchley.RELEASE</version>
<type> pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
</dependencies>
詳情請見spring官網:http://projects.spring.io/spring-cloud/