# Re: Disabling jarHell for plugins

**URL:** <https://discuss.elastic.co/t/re-disabling-jarhell-for-plugins/104972>\
**Category:** Elasticsearch\
**Created:** [October 23, 2017, 9:07pm UTC](https://discuss.elastic.co/t/re-disabling-jarhell-for-plugins/104972 "2017-10-23T21:07:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [October 23, 2017, 9:07pm UTC](https://discuss.elastic.co/t/re-disabling-jarhell-for-plugins/104972/1 "2017-10-23T21:07:24Z")

</div>

This mailing list does not send out an email to the original poster, so  
hopefully I can reply to my own sent email.

Shading jars will not work due to the way the plugin distribution is built.  
You cannot create an uber jar since the original runtime dependencies will  
always be included:

> <https://github.com/elastic/elasticsearch/blob/5.6/buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy#L133-L134>

Can jar hell be disabled for testing?

Cheers,

Ivan

---

<div class="post-metadata">

**Author:** ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)\
**Post date:** [October 23, 2017, 10:54pm UTC](https://discuss.elastic.co/t/re-disabling-jarhell-for-plugins/104972/2 "2017-10-23T22:54:30Z")

</div>

Jar hell checking cannot be disabled. But it is not clear to me from this post what problem you are trying to solve. If you have a conflict with ES core, you need to resolve that. Shading can work, you just need to add the dep in a separate configuration, then shade those dep jars together, either into another runtime jar, or into your plugin's jar itself.

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [October 24, 2017, 12:55am UTC](https://discuss.elastic.co/t/re-disabling-jarhell-for-plugins/104972/3 "2017-10-24T00:55:11Z")

</div>

The issue solely resides in the Derby dependencies which contain Java  
classes that overlap.

I can create my own configuration which will remove the specified  
dependencies from the plugin zip file, but the bundle task only knows about  
the original jar file and not the shaded jar (created via shadowJar)

Zip bundle = project.tasks.create(name: 'bundlePlugin', type: Zip,  
dependsOn: [project.jar, buildProperties]) {  
...  
from project.jar // this plugin's jar  
...  
}

Tried to get around it by "overriding" the jar task, but it does not work  
(as expected)

jar {  
shadowJar  
}

One possibility is to disregard the scaffolding the the plugin plugin  
provides and do my own bundling. All I need really is to disable jar shell  
on the test cluster. 🙂 Or just do away with integration tests.

Thanks,

Ivan

---

<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:** [November 21, 2017, 12:55am UTC](https://discuss.elastic.co/t/re-disabling-jarhell-for-plugins/104972/4 "2017-11-21T00:55:32Z")

</div>

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