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

zhengchenyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-uniffle.git


The following commit(s) were added to refs/heads/master by this push:
     new 477bc3037 [MINOR] chore: Fix the issue of license loss (#2248)
477bc3037 is described below

commit 477bc3037081d877317e7de27ad87e3dd42faee2
Author: zhengchenyu <[email protected]>
AuthorDate: Tue Nov 12 16:44:31 2024 +0800

    [MINOR] chore: Fix the issue of license loss (#2248)
    
    ### What changes were proposed in this pull request?
    
    Fix the issue of license loss
    
    ### Why are the changes needed?
    
    LICENSE file is missing but license directory which is from  
grpc-netty-shaded-1.61.1.jar exists.
    
    And when published maven artifacts, I can not close.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    test in dev and cluster
---
 client-spark/spark2-shaded/pom.xml | 20 ++++++++++++++++++++
 client-spark/spark3-shaded/pom.xml | 20 ++++++++++++++++++++
 release/publish_maven_artifacts.sh |  4 ++--
 3 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/client-spark/spark2-shaded/pom.xml 
b/client-spark/spark2-shaded/pom.xml
index 64628665c..274255abd 100644
--- a/client-spark/spark2-shaded/pom.xml
+++ b/client-spark/spark2-shaded/pom.xml
@@ -211,6 +211,10 @@
                   <pattern>picocli</pattern>
                   
<shadedPattern>${rss.shade.packageName}.picocli</shadedPattern>
                 </relocation>
+                <relocation>
+                  <pattern>META-INF/license</pattern>
+                  <shadedPattern>META-INF/license-tmp</shadedPattern>
+                </relocation>
               </relocations>
             </configuration>
           </execution>
@@ -301,6 +305,22 @@
                           
to="lib${rss.shade.native.packageName}_netty_transport_native_kqueue_aarch_64.jnilib"
                           type="glob"></mapper>
                 </move>
+                <!-- Since it may be compiled on case-insensitive operating 
system, it may be executed multiple times.
+                 Here the license directory, licenses directory, and LICENSE 
file are processed with aliases. -->
+                <move failonerror="false" quiet="true"
+                      
todir="${project.build.directory}/unpacked/META-INF/license-tmps">
+                  <fileset 
dir="${project.build.directory}/unpacked/META-INF/license-tmp">
+                    <include name="LICENSE*.txt"/>
+                  </fileset>
+                </move>
+                <delete failonerror="false" quiet="true"
+                        
dir="${project.build.directory}/unpacked/META-INF/license-tmp"/>
+                <move failonerror="false" quiet="true"
+                      
file="${project.build.directory}/unpacked/META-INF/license-tmps"
+                      
tofile="${project.build.directory}/unpacked/META-INF/licenses"/>
+                <move failonerror="false" quiet="true"
+                      
file="${project.build.directory}/unpacked/META-INF/LICENSE-binary"
+                      
tofile="${project.build.directory}/unpacked/META-INF/LICENSE"/>
                 <!-- Delete our NettyUtils to avoid errors like 
NoSuchMethodError, let Spark use its own NettyUtils -->
                 <!-- See https://github.com/apache/incubator-uniffle/pull/1565 
for more details -->
                 <delete 
dir="${project.build.directory}/unpacked/org/apache/spark/network"/>
diff --git a/client-spark/spark3-shaded/pom.xml 
b/client-spark/spark3-shaded/pom.xml
index 70cd33c10..4ead20a0f 100644
--- a/client-spark/spark3-shaded/pom.xml
+++ b/client-spark/spark3-shaded/pom.xml
@@ -211,6 +211,10 @@
                   <pattern>picocli</pattern>
                   
<shadedPattern>${rss.shade.packageName}.picocli</shadedPattern>
                 </relocation>
+                <relocation>
+                  <pattern>META-INF/license</pattern>
+                  <shadedPattern>META-INF/license-tmp</shadedPattern>
+                </relocation>
               </relocations>
             </configuration>
           </execution>
@@ -301,6 +305,22 @@
                           
to="lib${rss.shade.native.packageName}_netty_transport_native_kqueue_aarch_64.jnilib"
                           type="glob"></mapper>
                 </move>
+                <!-- Since it may be compiled on case-insensitive operating 
system, it may be executed multiple times.
+                 Here the license directory, licenses directory, and LICENSE 
file are processed with aliases. -->
+                <move failonerror="false" quiet="true"
+                      
todir="${project.build.directory}/unpacked/META-INF/license-tmps">
+                  <fileset 
dir="${project.build.directory}/unpacked/META-INF/license-tmp">
+                    <include name="LICENSE*.txt"/>
+                  </fileset>
+                </move>
+                <delete failonerror="false" quiet="true"
+                        
dir="${project.build.directory}/unpacked/META-INF/license-tmp"/>
+                <move failonerror="false" quiet="true"
+                      
file="${project.build.directory}/unpacked/META-INF/license-tmps"
+                      
tofile="${project.build.directory}/unpacked/META-INF/licenses"/>
+                <move failonerror="false" quiet="true"
+                      
file="${project.build.directory}/unpacked/META-INF/LICENSE-binary"
+                      
tofile="${project.build.directory}/unpacked/META-INF/LICENSE"/>
                 <echo message="repackaging netty jar"></echo>
                 <jar 
destfile="${project.build.directory}/${project.artifactId}-${project.version}.jar"
                      basedir="${project.build.directory}/unpacked"/>
diff --git a/release/publish_maven_artifacts.sh 
b/release/publish_maven_artifacts.sh
index be4253c53..91a6c41ff 100755
--- a/release/publish_maven_artifacts.sh
+++ b/release/publish_maven_artifacts.sh
@@ -52,7 +52,7 @@ copy_license_files() {
   cp -f "${PROJECT_DIR}/NOTICE-binary" \
   
"${PROJECT_DIR}/client-spark/spark2-shaded/src/main/resources/META-INF/NOTICE"
   cp -f "${PROJECT_DIR}/LICENSE-binary" \
-  
"${PROJECT_DIR}/client-spark/spark2-shaded/src/main/resources/META-INF/LICENSE"
+  
"${PROJECT_DIR}/client-spark/spark2-shaded/src/main/resources/META-INF/LICENSE-binary"
   rm -rf 
"${PROJECT_DIR}/client-spark/spark2-shaded/src/main/resources/META-INF/licenses"
   cp -rf "${PROJECT_DIR}/licenses-binary" \
   
"${PROJECT_DIR}/client-spark/spark2-shaded/src/main/resources/META-INF/licenses"
@@ -61,7 +61,7 @@ copy_license_files() {
   cp -f "${PROJECT_DIR}/NOTICE-binary" \
     
"${PROJECT_DIR}/client-spark/spark3-shaded/src/main/resources/META-INF/NOTICE"
   cp -f "${PROJECT_DIR}/LICENSE-binary" \
-    
"${PROJECT_DIR}/client-spark/spark3-shaded/src/main/resources/META-INF/LICENSE"
+    
"${PROJECT_DIR}/client-spark/spark3-shaded/src/main/resources/META-INF/LICENSE-binary"
   rm -rf 
"${PROJECT_DIR}/client-spark/spark3-shaded/src/main/resources/META-INF/licenses"
   cp -rf "${PROJECT_DIR}/licenses-binary" \
     
"${PROJECT_DIR}/client-spark/spark3-shaded/src/main/resources/META-INF/licenses"

Reply via email to