# X-pack: gradle task for building custom realm

**URL:** <https://discuss.elastic.co/t/x-pack-gradle-task-for-building-custom-realm/89213>\
**Category:** Elasticsearch\
**Created:** [June 13, 2017, 2:42pm UTC](https://discuss.elastic.co/t/x-pack-gradle-task-for-building-custom-realm/89213 "2017-06-13T14:42:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jathin](https://avatars.discourse-cdn.com/v4/letter/j/ea666f/32.png) [@Jathin](https://discuss.elastic.co/u/Jathin)\
**Post date:** [June 13, 2017, 2:42pm UTC](https://discuss.elastic.co/t/x-pack-gradle-task-for-building-custom-realm/89213/1 "2017-06-13T14:42:38Z")

</div>

Hi team,

I am following the steps mentioned in x-pack custom realm plugin example that is provided here.

> **[elastic/shield-custom-realm-example](https://github.com/elastic/shield-custom-realm-example)**
>
> Contribute to shield-custom-realm-example development by creating an account on GitHub.

i have some issues with junits, but i have disbaled junits for now, just commented out the tests methods.  
when i am building this gradle project i am getting some file built in distribution directory, but i was expecting a zip file that i can use with install step.

Can you please provide me steps to generate the zip file required for plugin install step.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [June 13, 2017, 3:13pm UTC](https://discuss.elastic.co/t/x-pack-gradle-task-for-building-custom-realm/89213/2 "2017-06-13T15:13:40Z")

</div>

Hey,

if you clone that repository and run `gradle clean check`, you will end up with a zip file in the `build/distributions` directory.

Can you paste your gradle run into a gist and also show which files end up in the distributions directory?

--Alex

---

<div class="post-metadata">

**Author:** ![Jathin](https://avatars.discourse-cdn.com/v4/letter/j/ea666f/32.png) [@Jathin](https://discuss.elastic.co/u/Jathin)\
**Post date:** [June 13, 2017, 7:00pm UTC](https://discuss.elastic.co/t/x-pack-gradle-task-for-building-custom-realm/89213/3 "2017-06-13T19:00:43Z")

</div>

i got that working now. But is there a way to add jar dependencies in there. I was able to complie and build the project, but not sure where i need to place my jar files. When placed in root folder, its getting droped.

I have some properties to read to can you suggest me a good place to place my properties that will be needed during runtime.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [June 15, 2017, 3:47pm UTC](https://discuss.elastic.co/t/x-pack-gradle-task-for-building-custom-realm/89213/4 "2017-06-15T15:47:38Z")

</div>

Hey,

just add your dependencies like in any gradle project and they are packaged.

--Alex

---

<div class="post-metadata">

**Author:** ![Jathin](https://avatars.discourse-cdn.com/v4/letter/j/ea666f/32.png) [@Jathin](https://discuss.elastic.co/u/Jathin)\
**Post date:** [June 15, 2017, 5:16pm UTC](https://discuss.elastic.co/t/x-pack-gradle-task-for-building-custom-realm/89213/5 "2017-06-15T17:16:50Z")

</div>

Just for the record, i had to update buildZip task to include dependencies into zip distribution.

`Preformatted text`task buildZip(type:Zip, dependsOn: [jar]) {  
....  
from configurations.runtime - configurations.provided  
}`Preformatted text`

Note: had to remove provided dependecies

---

<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:** [July 13, 2017, 5:16pm UTC](https://discuss.elastic.co/t/x-pack-gradle-task-for-building-custom-realm/89213/6 "2017-07-13T17:16:54Z")

</div>

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