# How to build Elasticsearch from source without xpack

**URL:** https://discuss.elastic.co/t/how-to-build-elasticsearch-from-source-without-xpack/256299
**Category:** Elasticsearch
**Created:** [November 23, 2020, 4:24am UTC](https://discuss.elastic.co/t/how-to-build-elasticsearch-from-source-without-xpack/256299 "2020-11-23T04:24:17Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![kayshu](https://avatars.discourse-cdn.com/v4/letter/k/b782af/32.png) [@kayshu](https://discuss.elastic.co/u/kayshu)
#### Post date: [November 23, 2020, 4:24am UTC](https://discuss.elastic.co/t/how-to-build-elasticsearch-from-source-without-xpack/256299/1 "2020-11-23T04:24:17Z")

</div>

Hi, i am trying to build a non-snapshot build of elasticsearch from source using

`gradle assemble -Dbuild.snapshot=false`

But I am getting the following exception

`Property license.key must be set for release build`

I think this is only required for `xpack`.

As we don't need xpack, how would one build elasticsearch without it?

Or how do I get the `license.key` mentioned in the exception?

---

<div class="post-metadata">

### Author: ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)
#### Post date: [November 23, 2020, 6:16am UTC](https://discuss.elastic.co/t/how-to-build-elasticsearch-from-source-without-xpack/256299/2 "2020-11-23T06:16:27Z")

</div>

Can I ask why you're trying to build a non-snapshot build of Elasticsearch from source?

It's likely that there's an easier solution to whatever problem you're trying to solve.

However, you can build specific OSS distributions using gradle if you want:  
e.g.

```auto
./gradlew :distribution:archives:oss-darwin-tar:assemble

```

---

<div class="post-metadata">

### Author: ![kayshu](https://avatars.discourse-cdn.com/v4/letter/k/b782af/32.png) [@kayshu](https://discuss.elastic.co/u/kayshu)
#### Post date: [November 23, 2020, 7:14am UTC](https://discuss.elastic.co/t/how-to-build-elasticsearch-from-source-without-xpack/256299/3 "2020-11-23T07:14:39Z")

</div>

Tim, thanks for the reply.

Due to legacy reasons, we were still using the older version (5.6) of elasticsearch for some of our on-premise setups, and upgrading to the latest is not possible at this point because of the amount of reindexing required. We are planning to move to 6. The problem is that if some bug is discovered later that is not backported to version 6.5 by ES Team, we should be able to patch it by ourselves. So we should know how to rebuild it from the source if such a situation arises.

The steps that you provided  
`./gradlew :distribution:archives:oss-darwin-tar:assemble`, still builds snapshot versions.

Is there any way to rebuild non-snapshot versions? What is the license that the exception talks about and how can we get it?

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [November 23, 2020, 7:17am UTC](https://discuss.elastic.co/t/how-to-build-elasticsearch-from-source-without-xpack/256299/4 "2020-11-23T07:17:43Z")

</div>

5.X has been [EOL](https://www.elastic.co/support/eol) for quite a long time now. You should really be looking to upgrade to 7.X instead of 6.X as well.

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [November 23, 2020, 8:58am UTC](https://discuss.elastic.co/t/how-to-build-elasticsearch-from-source-without-xpack/256299/5 "2020-11-23T08:58:51Z")

</div>

snapshot is "just" in the name. If you checked out the right tag, it should be good, whatever the final name is.

---

<div class="post-metadata">

### Author: ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)
#### Post date: [November 23, 2020, 11:12pm UTC](https://discuss.elastic.co/t/how-to-build-elasticsearch-from-source-without-xpack/256299/6 "2020-11-23T23:12:09Z")

</div>

The Elasticsearch 5.6 build didn't need a license.key, so whatever you are currently trying to build, it isn't the version you're after.

---

<div class="post-metadata">

### Author: ![kayshu](https://avatars.discourse-cdn.com/v4/letter/k/b782af/32.png) [@kayshu](https://discuss.elastic.co/u/kayshu)
#### Post date: [December 1, 2020, 6:13am UTC](https://discuss.elastic.co/t/how-to-build-elasticsearch-from-source-without-xpack/256299/7 "2020-12-01T06:13:04Z")

</div>

Sorry for the confusion, but I was trying to build ES 6.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [December 29, 2020, 6:13am UTC](https://discuss.elastic.co/t/how-to-build-elasticsearch-from-source-without-xpack/256299/8 "2020-12-29T06:13:23Z")

</div>

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