ES Coexistence with other projects using different gradle versions

I just built Elasticsearch for the first time. I followed the CONTRIBUTING.MD instructions, sort of.

There was a circular aspect to this journey.

"First install gradle. It must be version 2.13."

I already had two newer versions of gradle, and so I thought I should use the wrapper, gradlew.

The catch-22 (almost) was that when I cloned ES's repo to a new directory, the gradle wrapper command failed with a complaint that gradle version must be 2.13.

So I created a new directory, ran
gradle wrapper --gradle-version 2.13,
then copied the ES repo's ./.git into the new directory and ran
git reset --hard HEAD.

That seemed to work, and I got a first successful run of
./gradlew assemble

..shortly after.

Since ES uses such an old gradle version, and I can't be the only one who has to have other versions of gradle around,....

Is it worth updating CONTRIBUTING.MD or some other help location for new contributors to save people time with this? Even if not, maybe this question will contain enough answer for the next person. Maybe someone will want to say if I missed an obvious easier way.

Is it worth updating CONTRIBUTING.MD or some other help location for new contributors to save people time with this?

That sounds reasonable, although I'm not sure the method you found is the best one (but my Gradle knowledge is very limited).

For reasons I don't agree with Elastic has chosen to reject the gradlew recommendation (see issue #13744 for the discussion).

Thanks. Reading that link, I get the sense it's a mix of practical concerns and just "not familiar with the tool".

The use scenario I'm thinking of is, Mac OS User, may already have gradle (different version), wants to contribute, or at least build, debug, learn from source.

Without the wrapper, I'm not quite sure what I would do. I guess, try to hand install gradle 2.13, write a special .profile for this project, or get homebrew to do it, in the elasticsearch project. The gradle docs of course, immediately lead me to gradlew as the solution for side by side gradle versions.

A hint or preferred approach is the one thing that would have saved me time getting to the first successful build. The rest of the steps all went fine.

Thanks again. Not expecting further response.

Honestly we never thought it'd come this far. One of us has spoken with the gradle team in person about fixing the incompatibility and they promised to do it and just haven't. At least that is the story I've heard.

You can build Elasticsearch with Gradle 3+ if you use my patch at https://github.com/elastic/elasticsearch/compare/master...jprante:gradle3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.