maven 之 Spring Cloud Starter Alibaba Nacos Discovery

概述

版本注意:
  孵化版本(groupId为org.springframework.cloud):
      spring-cloud-alibaba-dependencies版本0.9.0:与Spring Cloud Greenwich兼容
      spring-cloud-alibaba-dependencies版本0.2.2:与Spring Cloud Finchley兼容
      且若想支持动态刷新配置,Spring Boot必须引用2.0.X版本系列的,大于或者等于2.1.X版本的暂时不支持动态刷新配置!

毕业版本(groupId为com.alibaba.cloud目前基本用这个了):
      spring-cloud-alibaba-dependencies版本2.1.0.RELEASE:与Spring Cloud Greenwich兼容
      spring-cloud-alibaba-dependencies版本2.2.0.RELEASE:与Spring Cloud Hoxton兼容

org.springframework.cloud


<dependency>
    <groupId>org.springframework.cloudgroupId>
    <artifactId>spring-cloud-starter-alibaba-nacos-discoveryartifactId>
    <version>0.2.2.RELEASEversion>
dependency>

maven 之 Spring Cloud Starter Alibaba Nacos Discovery_第1张图片

com.alibaba.cloud

<!-- https://mvnrepository.com/artifact/com.alibaba.cloud/spring-cloud-starter-alibaba-nacos-discovery -->
<dependency>
    <groupId>com.alibaba.cloud</groupId>
    <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
    <version>2.0.4.RELEASE</version>
</dependency>

注意:部分版本没有源码,2.0.4.RELEASE有源码
maven 之 Spring Cloud Starter Alibaba Nacos Discovery_第2张图片
需要注意版本依赖:
maven 之 Spring Cloud Starter Alibaba Nacos Discovery_第3张图片
完整示例:

   <properties>
        <spring-boot.version>2.3.2.RELEASE</spring-boot.version>
        <spring-cloud.version>Hoxton.SR8</spring-cloud.version>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>

      <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>fastjson</artifactId>
                <version>1.2.62</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba.cloud</groupId>
                <artifactId>spring-cloud-alibaba-dependencies</artifactId>
                <version>2.2.5.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

参考

pring-Cloud-Alibaba(一):Nacos服务注册与配置中心 参考2个版本介绍

你可能感兴趣的:(spring,cloud,nacos,Discovery)