-
-
Notifications
You must be signed in to change notification settings - Fork 423
module-info.class in Multi-Release folders is not excluded by default #729
Copy link
Copy link
Closed
Milestone
Description
Shadow Version
7.1.0
Gradle Version
Gradle 7.3
Expected Behavior
module-info.class in Multi-Release folders should be excluded by default (see also #352).
Some libraries (such as Log4j 2) include the module-info.class in the Multi-Release JAR folder META-INF/versions/<version> to keep compatibility with < Java 9, but at the same time define a module descriptor for JREs >= Java 9.
There is no point in keeping these module descriptor classes because they are specific to a shadowed library and not relevant (or incorrect) for the resulting 'fat JAR'.
This becomes even more important once #449 has been implemented.
Actual Behavior
The shadowed JAR contains module-info.class files in the Multi-Release JAR folder META-INF/versions/<version>.
Gradle Build Script(s)
build.gradle.kts
plugins {
java
id("com.github.johnrengelman.shadow") version "7.1.0"
}
repositories {
mavenCentral()
}
dependencies {
implementation(platform("org.apache.logging.log4j:log4j-bom:2.14.1"))
implementation("org.apache.logging.log4j:log4j-api")
implementation("org.apache.logging.log4j:log4j-core")
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}Content of Shadow JAR (jar tf <jar file> - post link to GIST if too long)
META-INF/versions/9/module-info.class- ...
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels