概述
下载github源码
https://github.com/elastic/elasticsearch.git
解压源码文件
E:workspaceideademoelasticsearch-6.2.4
1)elasticsearch-6.2.4CONTRIBUTING.md 源码编译说明
JDK 9 is required to build Elasticsearch.
intelliJ, the minimum version that we support is IntelliJ 2017.2
intelliJ users can automatically configure their IDE: ./gradlew idea2)elasticsearch-6.2.4gradlewrappergradle-wrapper.properties
gradle-4.5
构建环境
Win7
Gradle4.5
Jdk9
IntelliJ 2017.2
安装jdk9
https://www.oracle.com/technetwork/java/javase/archive-139210.html
下载gradle
https://downloads.gradle-dn.com/distributions/gradle-4.5-all.zip
gradle环境配置
https://blog.csdn.net/chy2z/article/details/103394264
ES源码配置gradle
1)将gradle放到wrapper目录中
E:workspaceideademoelasticsearch-6.2.4gradlewrappergradle-4.5-all.zip
2)修改gradle-wrapper.properties文件内容:
distributionUrl=gradle-4.5-all.zip
3)配置全局Maven仓库地址
新建init.gradle文件
目录:C:Users用户名.gradleinit.gradle
内容:
buildscript {
repositories {
maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
}
dependencies {
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
}
}
4)修改benchmarksbuild.gradle 文件
E:workspaceideademoelasticsearch-6.2.4benchmarksbuild.gradle 文件repositories
buildscript {
repositories {
maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.2'
}
}
5)修改clientbenchmarkbuild.gradle 文件
E:workspaceideademoelasticsearch-6.2.4clientbenchmarkbuild.gradle 文件repositories
buildscript {
repositories {
maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.2'
}
}
6)修改distributionbuild.gradle 文件
E:workspaceideademoelasticsearch-6.2.4distributionbuild.gradle 文件repositories
buildscript {
repositories {
maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
}
dependencies {
classpath 'com.netflix.nebula:gradle-ospackage-plugin:3.4.0'
}
}
7)修改buildSrcbuild.gradle 文件
E:workspaceideademoelasticsearch-6.2.4buildSrcbuild.gradle 文件repositories
repositories {
maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
}
gradle构建生成idea项目
在cmd中执行 gradlew idea 命令
中间由于依赖的jar包在maven仓库没有,需要等中心仓库下载,中间重试很多次gradlew idea命令,才把所有的jar包下载完毕。
构建成功
最后
以上就是跳跃路人为你收集整理的elasticsearch6.2.4源码Gradle构建idea环境(1)的全部内容,希望文章能够帮你解决elasticsearch6.2.4源码Gradle构建idea环境(1)所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复