编译spring-cloud-gateway-2.2.1.RELEASE源码

鲲鹏镜像站中提供的二进制包是基于开源代码直接编译打包而成的,不含漏洞及BUG修复。
使用开源软件时需遵守开源软件的许可协议。
- 下载spring-cloud-gateway-2.2.1.RELEASE源码。
1 2 3
cd /home git config --global http.sslVerify false git clone https://github.com/spring-cloud/spring-cloud-gateway.git
- 切换到指定版本。
1 2
cd spring-cloud-gateway git checkout v2.2.1.RELEASE
- 将编译过程中拉取的embedded-redis-0.6.jar包替换成ARM版本的。
- 创建库目录“~/.m2/repository/com/github/kstyrc/embedded-redis/0.6/”。
1
mkdir -p ~/.m2/repository/com/github/kstyrc/embedded-redis/0.6/
- 获取embedded-redis-0.6.jar包。
1
wget https://mirrors.huaweicloud.com/kunpeng/maven/com/github/kstyrc/embedded-redis/0.6/embedded-redis-0.6.jar --no-check-certificate
- 将下载的Jar包复制到库目录下。
1
cp embedded-redis-0.6.jar ~/.m2/repository/com/github/kstyrc/embedded-redis/0.6/embedded-redis-0.6.jar
- 创建库目录“~/.m2/repository/com/github/kstyrc/embedded-redis/0.6/”。
- 执行编译。
1
./mvnw clean install -Dgpg.skip=true
若显示BUILD SUCCESS,则编译通过。
- 如果编译报错“Some problems were encountered while processing the POMs”,则执行下面命令编译。
mvn clean install -Dgpg.skip=true
- 如果编译因checkstyle报错,参考编译Spring Boot时提示Failed during checkstyle execution的解决方法。
- 若编译出现"Spring Cloud Gateway Core .......................... FAILURE",并且出现“No content,404 NOT_FOUND Not Found”,是由于代理问题,需多执行几遍。
- 如果编译时遇到RetryGatewayFilterFactoryIntegrationTests报错,此问题与编译环境网络状况有关,请参考spring-cloud-gateway异常问题的解决方法解决。
若按照spring-cloud-gateway异常问题的解决方法操作后还是编译不通过,可能是由于老旧机械盘读写能力较弱,导致处理业务的时延较高,建议用户使用性能较优的磁盘进行业务验证,例如SSD盘。
- 如果编译报错“Some problems were encountered while processing the POMs”,则执行下面命令编译。
父主题: 编译安装