Skip to content

Commit

Permalink
(fix) Automatically exclude 'module-info.class'
Browse files Browse the repository at this point in the history
  • Loading branch information
John Engelman committed Sep 16, 2018
1 parent c4abfc3 commit 275382c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/docs/asciidoc/90-changes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ShadowJavaPlugin implements Plugin<Project> {
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()
Expand Down

1 comment on commit 275382c

@CSK73
Copy link

@CSK73 CSK73 commented on 275382c Mar 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @johnrengelman , I am trying to create ShadowJar using 7.0.0 plugin. I see 'module-info.class' file is excluded from the fat jar. Is there a way to include it when we build the jar?

Looks like someone already filed similar ticket #710

Thanks,
CSK

Please sign in to comment.