From 275382cef77df1cdce2b2b53568541933fd5d9cd Mon Sep 17 00:00:00 2001 From: John Engelman Date: Sun, 16 Sep 2018 13:43:09 -0500 Subject: [PATCH] (fix) Automatically exclude 'module-info.class' --- src/docs/asciidoc/90-changes.adoc | 1 + .../jengelman/gradle/plugins/shadow/ShadowJavaPlugin.groovy | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/docs/asciidoc/90-changes.adoc b/src/docs/asciidoc/90-changes.adoc index 4a9636a1b..a38568921 100644 --- a/src/docs/asciidoc/90-changes.adoc +++ b/src/docs/asciidoc/90-changes.adoc @@ -8,6 +8,7 @@ * https://github.com/paul-nelson-baker[Paul N. Baker] - Add `Log4j2PluginsCacheFileTransformer` to process Log4j DAT files during merge. * https://github.com/felipecsl[Felipe Lima] - Fix the long standing "No property `mainClassName`" issue. * https://github.com/debanne[debanne] - Implement JAR minimization actions. This will attempt to exclude unused classes in your shadowed JAR. +* Configure exclusion of `module-info.class` from `shadowJar` when using the Shadow the Java plugin. https://github.com/johnrengelman/shadow/issues/352[#352] [discrete] diff --git a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/ShadowJavaPlugin.groovy b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/ShadowJavaPlugin.groovy index e1e2fcf57..7306224c2 100644 --- a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/ShadowJavaPlugin.groovy +++ b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/ShadowJavaPlugin.groovy @@ -57,7 +57,7 @@ class ShadowJavaPlugin implements Plugin { shadow.from(convention.sourceSets.main.output) shadow.configurations = [project.configurations.findByName('runtimeClasspath') ? project.configurations.runtimeClasspath : project.configurations.runtime] - shadow.exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA') + shadow.exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA', 'module-info.class') project.artifacts.add(ShadowBasePlugin.CONFIGURATION_NAME, shadow) configureShadowUpload()