Skip to content

Commit d924e4d

Browse files
committed
Mark shaded application's jar as multi-release by default
Spring Framework now uses a multi-release jar for its virtual thread support. If the shaded jar is not marked as being a multi-release jar and virtual threads are enabled, the application will fail to start as the Java 21+ virtual threads delegate will be unavailable. This commit updates the starter parent's default configuration for the Maven Shade plugin to set Multi-Release: true in the application's manifest. Closes gh-43284
1 parent bb3651b commit d924e4d

File tree

1 file changed

+4
-1
lines changed
  • spring-boot-project/spring-boot-starters/spring-boot-starter-parent

1 file changed

+4
-1
lines changed

spring-boot-project/spring-boot-starters/spring-boot-starter-parent/build.gradle

+4-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,10 @@ publishing.publications.withType(MavenPublication) {
234234
}
235235
transformer(implementation: 'org.apache.maven.plugins.shade.resource.ServicesResourceTransformer')
236236
transformer(implementation: 'org.apache.maven.plugins.shade.resource.ManifestResourceTransformer') {
237-
delegate.mainClass('${start-class}')
237+
manifestEntries {
238+
delegate.'Main-Class'('${start-class}')
239+
delegate.'Multi-Release'('true')
240+
}
238241
}
239242
}
240243
}

0 commit comments

Comments
 (0)