1818 */
1919package org.elasticsearch.gradle.plugin
2020
21+ import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
2122import nebula.plugin.info.scm.ScmInfoPlugin
2223import org.elasticsearch.gradle.BuildPlugin
2324import org.elasticsearch.gradle.NoticeTask
2425import org.elasticsearch.gradle.test.RestIntegTestTask
2526import org.elasticsearch.gradle.test.RunTask
27+ import org.gradle.api.InvalidUserDataException
2628import org.gradle.api.JavaVersion
2729import org.gradle.api.Project
2830import org.gradle.api.Task
@@ -46,6 +48,18 @@ public class PluginBuildPlugin extends BuildPlugin {
4648 @Override
4749 public void apply (Project project ) {
4850 super . apply(project)
51+ project. plugins. withType(ShadowPlugin ). whenPluginAdded {
52+ /*
53+ * We've not tested these plugins together and we're fairly sure
54+ * they aren't going to work properly as is *and* we're not really
55+ * sure *why* you'd want to shade stuff in plugins. So we throw an
56+ * exception here to make you come and read this comment. If you
57+ * have a need for shadow while building plugins then know that you
58+ * are probably going to have to fight with gradle for a while....
59+ */
60+ throw new InvalidUserDataException (' elasticsearch.esplugin is not '
61+ + ' compatible with com.github.johnrengelman.shadow' );
62+ }
4963 configureDependencies(project)
5064 // this afterEvaluate must happen before the afterEvaluate added by integTest creation,
5165 // so that the file name resolution for installing the plugin will be setup
0 commit comments