This is an automated email from the ASF dual-hosted git repository.

jshao pushed a commit to branch branch-0.7
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/branch-0.7 by this push:
     new 74dd48a28 [#4661] improve(build): Add LICENSE and NOTICE file to jar 
(#5330)
74dd48a28 is described below

commit 74dd48a2887261571858f8615b7a3fa4e17eb3a3
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Oct 29 14:33:00 2024 +0800

    [#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 <[email protected]>
---
 build.gradle.kts | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/build.gradle.kts b/build.gradle.kts
index 16525e3fb..d96ab3865 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> {

Reply via email to