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

Gray Server 依赖问题

坑:swagger2依赖必须

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<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官方克隆源码,将所有的`${revision}`替换为实际的版本号
  • deploy spring-cloud-gray,将spring-cloud-gray下所有依赖库推到私服
  • 删除Jenkins本地Maven仓库相关依赖,重新Build即可
1
2
cd /root/.m2/repository/cn/springcloud/gray
rm -rf *

开启Debug日志

1
2
3
4
logging:
config: classpath:logback-spring.xml
level:
cn.springcloud.gray: debug

Powered by AppBlog.CN     浙ICP备14037229号

Copyright © 2012 - 2020 APP开发技术博客 All Rights Reserved.

访客数 : | 访问量 :