Skip to content

Commit 327123a

Browse files
romtsncodex
andcommitted
docs(build): Document Spring metadata merge action
Explain that MergeSpringMetadataAction patches shadow JARs by merging Spring metadata with file-specific semantics and by preserving service-provider registrations from the runtime classpath. This keeps the intent of the build logic clear without changing behavior. Co-Authored-By: Codex <noreply@openai.com>
1 parent 7b05a2b commit 327123a

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

buildSrc/src/main/java/MergeSpringMetadataAction.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ import org.gradle.api.Task
88
import org.gradle.api.file.FileCollection
99
import org.gradle.api.tasks.bundling.AbstractArchiveTask
1010

11+
/**
12+
* Patches a built shadow JAR by merging Spring metadata and service descriptor files from the
13+
* runtime classpath into the final archive.
14+
*
15+
* Spring metadata files do not all share the same merge semantics, so this action merges
16+
* `spring.factories` as list properties, `.imports` files as line-based metadata, and other Spring
17+
* metadata as key/value properties. It also deduplicates service-provider configuration entries
18+
* under `META-INF/services` so the flat executable JAR keeps the runtime registrations it needs.
19+
*/
1120
class MergeSpringMetadataAction(
1221
private val runtimeClasspath: FileCollection,
1322
private val springMetadataFiles: List<String>,

0 commit comments

Comments
 (0)