From 74dd48a2887261571858f8615b7a3fa4e17eb3a3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 14:33:00 +0800 Subject: [PATCH] [#4661] improve(build): Add LICENSE and NOTICE file to jar (#5330) ### What changes were proposed in this pull request? Add LICENSE and NOTICE files to the built jars. ### Why are the changes needed? To meet the requirement. Fix: #4661 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Local verification. Co-authored-by: Jerry Shao --- build.gradle.kts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index 16525e3fbd..d96ab3865a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -371,6 +371,22 @@ subprojects { from(tasks["javadoc"]) } + tasks.withType { + into("META-INF") { + from(rootDir) { + if (name == "sourcesJar") { + include("LICENSE") + include("NOTICE") + } else { + include("LICENSE.bin") + rename("LICENSE.bin", "LICENSE") + include("NOTICE.bin") + rename("NOTICE.bin", "NOTICE") + } + } + } + } + if (project.name in listOf("web", "docs")) { plugins.apply(NodePlugin::class) configure {