Spring Cloud Gray接入及部署采坑记录

Gray Server 依赖问题

坑:swagger2依赖必须

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-validation</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
    </dependency>
    <dependency>
        <groupId>cn.springcloud.gray</groupId>
        <artifactId>spring-cloud-starter-gray-server</artifactId>
        <version>${spring-cloud-gray.version}</version>
    </dependency>
    <dependency>
        <groupId>cn.springcloud.gray</groupId>
        <artifactId>spring-cloud-gray-server-plugin-eureka</artifactId>
        <version>${spring-cloud-gray.version}</version>
    </dependency>
    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger2</artifactId>
        <version>${springfox.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.mapstruct</groupId>
                <artifactId>mapstruct</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
</dependencies>

公共仓库revision问题

解决方案:

  • 从Github官方克隆源码,将所有的{% raw %}${revision}{% endraw %}替换为实际的版本号
  • deploy spring-cloud-gray,将spring-cloud-gray下所有依赖库推到私服
  • 删除Jenkins本地Maven仓库相关依赖,重新Build即可
cd /root/.m2/repository/cn/springcloud/gray
rm -rf *

开启Debug日志

logging:
  config: classpath:logback-spring.xml
  level: 
    cn.springcloud.gray: debug

版权声明:
作者:Joe.Ye
链接:https://www.appblog.cn/index.php/2023/03/27/spring-cloud-gray-access-and-deployment-pit-record/
来源:APP全栈技术分享
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
打赏
海报
Spring Cloud Gray接入及部署采坑记录
Gray Server 依赖问题 坑:swagger2依赖必须 <dependencies> <dependency> <groupId>org.springframework.boot</groupId……
<<上一篇
下一篇>>
文章目录
关闭
目 录