This is an automated email from the ASF dual-hosted git repository.
jshao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/main by this push:
new 80521fdb1 [#4661] improve(build): Add LICENSE and NOTICE file to jar
(#5273)
80521fdb1 is described below
commit 80521fdb1dd642d60330da21fb83bf72276d8470
Author: Jerry Shao <[email protected]>
AuthorDate: Tue Oct 29 13:15:11 2024 +0800
[#4661] improve(build): Add LICENSE and NOTICE file to jar (#5273)
### 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.
---
build.gradle.kts | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/build.gradle.kts b/build.gradle.kts
index 6b272101e..453cadf9d 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -371,6 +371,22 @@ subprojects {
from(tasks["javadoc"])
}
+ tasks.withType<Jar> {
+ 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<NodeExtension> {