Skip to content

Commit 477bc30

Browse files
authored
[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
1 parent 4db95c3 commit 477bc30

File tree

3 files changed

+42
-2
lines changed

3 files changed

+42
-2
lines changed

client-spark/spark2-shaded/pom.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@
211211
<pattern>picocli</pattern>
212212
<shadedPattern>${rss.shade.packageName}.picocli</shadedPattern>
213213
</relocation>
214+
<relocation>
215+
<pattern>META-INF/license</pattern>
216+
<shadedPattern>META-INF/license-tmp</shadedPattern>
217+
</relocation>
214218
</relocations>
215219
</configuration>
216220
</execution>
@@ -301,6 +305,22 @@
301305
to="lib${rss.shade.native.packageName}_netty_transport_native_kqueue_aarch_64.jnilib"
302306
type="glob"></mapper>
303307
</move>
308+
<!-- Since it may be compiled on case-insensitive operating system, it may be executed multiple times.
309+
Here the license directory, licenses directory, and LICENSE file are processed with aliases. -->
310+
<move failonerror="false" quiet="true"
311+
todir="${project.build.directory}/unpacked/META-INF/license-tmps">
312+
<fileset dir="${project.build.directory}/unpacked/META-INF/license-tmp">
313+
<include name="LICENSE*.txt"/>
314+
</fileset>
315+
</move>
316+
<delete failonerror="false" quiet="true"
317+
dir="${project.build.directory}/unpacked/META-INF/license-tmp"/>
318+
<move failonerror="false" quiet="true"
319+
file="${project.build.directory}/unpacked/META-INF/license-tmps"
320+
tofile="${project.build.directory}/unpacked/META-INF/licenses"/>
321+
<move failonerror="false" quiet="true"
322+
file="${project.build.directory}/unpacked/META-INF/LICENSE-binary"
323+
tofile="${project.build.directory}/unpacked/META-INF/LICENSE"/>
304324
<!-- Delete our NettyUtils to avoid errors like NoSuchMethodError, let Spark use its own NettyUtils -->
305325
<!-- See https://github.com/apache/incubator-uniffle/pull/1565 for more details -->
306326
<delete dir="${project.build.directory}/unpacked/org/apache/spark/network"/>

client-spark/spark3-shaded/pom.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@
211211
<pattern>picocli</pattern>
212212
<shadedPattern>${rss.shade.packageName}.picocli</shadedPattern>
213213
</relocation>
214+
<relocation>
215+
<pattern>META-INF/license</pattern>
216+
<shadedPattern>META-INF/license-tmp</shadedPattern>
217+
</relocation>
214218
</relocations>
215219
</configuration>
216220
</execution>
@@ -301,6 +305,22 @@
301305
to="lib${rss.shade.native.packageName}_netty_transport_native_kqueue_aarch_64.jnilib"
302306
type="glob"></mapper>
303307
</move>
308+
<!-- Since it may be compiled on case-insensitive operating system, it may be executed multiple times.
309+
Here the license directory, licenses directory, and LICENSE file are processed with aliases. -->
310+
<move failonerror="false" quiet="true"
311+
todir="${project.build.directory}/unpacked/META-INF/license-tmps">
312+
<fileset dir="${project.build.directory}/unpacked/META-INF/license-tmp">
313+
<include name="LICENSE*.txt"/>
314+
</fileset>
315+
</move>
316+
<delete failonerror="false" quiet="true"
317+
dir="${project.build.directory}/unpacked/META-INF/license-tmp"/>
318+
<move failonerror="false" quiet="true"
319+
file="${project.build.directory}/unpacked/META-INF/license-tmps"
320+
tofile="${project.build.directory}/unpacked/META-INF/licenses"/>
321+
<move failonerror="false" quiet="true"
322+
file="${project.build.directory}/unpacked/META-INF/LICENSE-binary"
323+
tofile="${project.build.directory}/unpacked/META-INF/LICENSE"/>
304324
<echo message="repackaging netty jar"></echo>
305325
<jar destfile="${project.build.directory}/${project.artifactId}-${project.version}.jar"
306326
basedir="${project.build.directory}/unpacked"/>

release/publish_maven_artifacts.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ copy_license_files() {
5252
cp -f "${PROJECT_DIR}/NOTICE-binary" \
5353
"${PROJECT_DIR}/client-spark/spark2-shaded/src/main/resources/META-INF/NOTICE"
5454
cp -f "${PROJECT_DIR}/LICENSE-binary" \
55-
"${PROJECT_DIR}/client-spark/spark2-shaded/src/main/resources/META-INF/LICENSE"
55+
"${PROJECT_DIR}/client-spark/spark2-shaded/src/main/resources/META-INF/LICENSE-binary"
5656
rm -rf "${PROJECT_DIR}/client-spark/spark2-shaded/src/main/resources/META-INF/licenses"
5757
cp -rf "${PROJECT_DIR}/licenses-binary" \
5858
"${PROJECT_DIR}/client-spark/spark2-shaded/src/main/resources/META-INF/licenses"
@@ -61,7 +61,7 @@ copy_license_files() {
6161
cp -f "${PROJECT_DIR}/NOTICE-binary" \
6262
"${PROJECT_DIR}/client-spark/spark3-shaded/src/main/resources/META-INF/NOTICE"
6363
cp -f "${PROJECT_DIR}/LICENSE-binary" \
64-
"${PROJECT_DIR}/client-spark/spark3-shaded/src/main/resources/META-INF/LICENSE"
64+
"${PROJECT_DIR}/client-spark/spark3-shaded/src/main/resources/META-INF/LICENSE-binary"
6565
rm -rf "${PROJECT_DIR}/client-spark/spark3-shaded/src/main/resources/META-INF/licenses"
6666
cp -rf "${PROJECT_DIR}/licenses-binary" \
6767
"${PROJECT_DIR}/client-spark/spark3-shaded/src/main/resources/META-INF/licenses"

0 commit comments

Comments
 (0)