Yao Pan
Yao Pan

Reputation: 524

how to build Elasticsearch source code using gradle?

I download elasticsearch source code from :https://github.com/elastic/elasticsearch,

I found there is a build.gradlefile,and I have install gradle, how to build source it?

enter image description here

Upvotes: 2

Views: 5636

Answers (2)

carusyte
carusyte

Reputation: 1769

gradle assemble seems to yield some errors such as cannot find symbol in my macOS environment.

According to the latest description in the repo (as of time writing the answer):

To build a distribution for your local OS and print its output location upon completion, run:

./gradlew localDistro

To build a distribution for another platform, run the related command:

./gradlew :distribution:archives:linux-tar:assemble
./gradlew :distribution:archives:darwin-tar:assemble
./gradlew :distribution:archives:windows-zip:assemble

To build distributions for all supported platforms, run:

./gradlew assemble

Distributions are output to distributions/archives.

Upvotes: 1

Stanislav
Stanislav

Reputation: 28106

There is a description fo the way you can build it in the readme file in the repo. According to it:

Building from Source

Elasticsearch uses Gradle for its build system. You’ll need to have version 2.13 of Gradle installed.

In order to create a distribution, simply run the gradle assemble command in the cloned directory.

The distribution for each project will be created under the build/distributions directory in that project.

See the TESTING file for more information about running the Elasticsearch test suite.

So all you need is to get into the root directory and in command line call gradle assemble, if you have Gradle installed properly, you will find all artifacts under build/distributions directory

Upvotes: 2

Related Questions