elasticsearch-hadoop.jar 6.8版本编译异常

文章讲述了在尝试编译elasticsearch-hadoop6.8版本时遇到的依赖问题,包括Spring构建工具插件、Cascading库和Elasticsearch构建工具的版本。作者提供了通过修改gradle仓库和替换失效的conjar仓库的解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

## 背景

重新编译 elasticsearch-hadoop 包;

GitHub - elastic/elasticsearch-hadoop at 6.8

编译 7.17 版本时很正常,注意设置下环境变量就好,JAVA8_HOME/....

编译 6.8 版本时(要求jdk8 / jdk9),出现异常

1. Could not resolve org.springframework.build.gradle:propdeps-plugin:0.0.7.

2. Could not resolve cascading:cascading-local:2.6.3.

3. Could not resolve org.elasticsearch.gradle:build-tools:6.8.24-SNAPSHOT

4. Could not resolve cascading:cascading-hadoop:2.6.3.

## 分析(尝试逐个解决)

1. gradle 仓库修改

    // ali库 解决 Could not resolve org.springframework.build.gradle:propdeps-plugin:0.0.7.
    maven{ url 'https://maven.aliyun.com/repository/central'}
    maven{ url 'https://maven.aliyun.com/repository/public' }
    maven{ url 'https://maven.aliyun.com/repository/google'}
    maven{ url 'https://maven.aliyun.com/repository/gradle-plugin'}
    maven{ url 'https://maven.aliyun.com/repository/spring'}
    maven{ url 'https://maven.aliyun.com/repository/spring-plugin'}
    maven{ url 'https://maven.aliyun.com/mvn/guide'}
    maven{ url 'https://maven.aliyun.com/repository/apache-snapshots'}

2. esh-version.properties 修改

6.8.24-SNAPSHOT -> 6.8.23

3. cascading-local 这个包始终无法获取

## 最终解决

本质原因有2个,一个是 repo.spring.io 改造成需要验证了,不验证会有401;另一个是http://conjars.org/repo 已经失效了,需要替换;

所以前面修改的全部回滚,完整解决方案如下:

1. 处理 propdeps-plugin 包,增加阿里云的库

    // ali库 propdeps-plugin
    maven{ url 'https://maven.aliyun.com/repository/central'}
    maven{ url 'https://maven.aliyun.com/repository/public' }
    maven{ url 'https://maven.aliyun.com/repository/google'}
    maven{ url 'https://maven.aliyun.com/repository/gradle-plugin'}
    maven{ url 'https://maven.aliyun.com/repository/spring'}
    maven{ url 'https://maven.aliyun.com/repository/spring-plugin'}
    maven{ url 'https://maven.aliyun.com/mvn/guide'}
    maven{ url 'https://maven.aliyun.com/repository/apache-snapshots'}

2. 修改 buildSrc/src/main/groovy/org/elasticsearch/hadoop/gradle/BuildPlugin.groovy

全部的 http://conjars.org/repo 或者 https://conjars.org/repo

替换成 https://conjars.wensel.net/repo

## 参考:

1. Notice of Permissions Changes to repo.spring.io, January 2023

2. https://segmentfault.com/q/1010000043853512

3. spring源码编译问题解决1,Received status code 401 from server问题,not found问题,更换阿里云镜像_received status code 401 from server:-CSDN博客

 4. https://github.com/elastic/elasticsearch-hadoop/issues/984

 5. How to build a plugin for a not yet released version? - Elasticsearch - Discuss the Elastic Stack

6. conjars.org: Connection timed out_http://conjars.org/repo 地址失效-CSDN博客

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值