當前位置:編程學習大全網 - 源碼下載 - 2019-10-31 spring Cloud 無法註冊到nacos問題

2019-10-31 spring Cloud 無法註冊到nacos問題

最近在學習nacos的使用,按照官方文檔寫了壹個SpringCloud+nacos的小demo,卻發現註冊進nacos註冊中心,日誌是這樣的:

後來發現我springboot的版本是2.2.0.RELEASE

降低到 2.0.8.RELEASE後就能註冊了,和nacos的官網說明:版本 0.2.x.RELEASE 對應的是 Spring Boot 2.x 版本,版本 0.1.x.RELEASE 對應的是 Spring Boot 1.x 版本有些偏差。

此處:nacos 1.1.4? 、

pom.xml如下

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns=".candy</groupId>

<artifactId>nacos-remotecall</artifactId>

<version>0.0.1-SNAPSHOT</version>

<name>nacos-remotecall</name>

<description>Demo project for Spring Boot</description>

<properties>

<java.version>1.8</java.version>

<junit.version>4.10</junit.version>

<spring-cloud.version>Finchley.SR2</spring-cloud.version>

</properties>

<dependencies>

<dependency>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-starter-web</artifactId>

</dependency>

<dependency>

<groupId>org.springframework.cloud</groupId>

<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>

<version>0.9.0.RELEASE</version>

</dependency>

<dependency>

<groupId>org.springframework.cloud</groupId>

<artifactId>spring-cloud-starter-openfeign</artifactId>

<version>2.0.0.RELEASE</version>

</dependency>

<dependency>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-starter-test</artifactId>

<scope>test</scope>

<exclusions>

<exclusion>

<groupId>org.junit.vintage</groupId>

<artifactId>junit-vintage-engine</artifactId>

</exclusion>

</exclusions>

</dependency>

<dependency>

<groupId>junit</groupId>

<artifactId>junit</artifactId>

<version>${junit.version}</version>

<scope>test</scope>

</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>

<build>

<plugins>

<plugin>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-maven-plugin</artifactId>

</plugin>

</plugins>

</build>

</project>

  • 上一篇:英雄無敵3問題
  • 下一篇:Harmonyos源代碼捐贈
  • copyright 2024編程學習大全網