-
Notifications
You must be signed in to change notification settings - Fork 897
Clean up deps licenses, as they are now included in the original JARs #3330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Could you please clarify what exact issue does the PR resolve? |
Is just a chore to avoid duplicated license copies in the sourceDistribution. |
The PR title says "exclude META-INF/LICENSE", so I assumed you wanted to exclude it completely. By the way, what are the duplicates in your opinion? |
0d854a3
to
e570e2d
Compare
Agree, it was not clear, I changed the title to "Avoid duplicate dependencies licenses in sourceDistribution"
When building the source distribution, it contains the LICENSE file in This excludes the I guess you could handle this better on the |
I believe "extra" copies come from https://github.com/pgjdbc/pgjdbc/tree/cdf429c5e774aa66df4dbe24e2b7f74e756f5e7f/licenses Have you tried removing them instead? |
Yes, I tried removing them, but it does not work as expected, the shadowJar adds two
Maybe a bug on the |
e570e2d
to
a5f8c40
Compare
Check the latest changes, and the shadow JAR contains a duplicate |
Can you please clarify the exact command you perform to check for the duplicates? I tried a5f8c40, and
|
Check the
|
I would suggest the following: diff --git a/pgjdbc/build.gradle.kts b/pgjdbc/build.gradle.kts
index 86a06b55..9c5e6fa1 100644
--- a/pgjdbc/build.gradle.kts
+++ b/pgjdbc/build.gradle.kts
@@ -218,9 +218,12 @@ tasks.shadowJar {
exclude("META-INF/versions/9/module-info.class")
// ignore service file not used in shaded dependency
exclude("META-INF/services/com.ongres.stringprep.Profile")
- into("META-INF") {
- dependencyLicenses(shadedLicenseFiles)
- }
+ // We explicitly exclude all license-like files, and we re-add them in osgiJar later
+ // It looks like shadowJar can't filter out META-INF/LICENSE, and files with the same name
+ exclude("META-INF/LICENSE*")
+ exclude("META-INF/NOTICE*")
+ exclude("LICENSE")
+ exclude("NOTICE")
listOf(
"com.ongres"
).forEach {
@@ -231,6 +234,9 @@ tasks.shadowJar {
val osgiJar by tasks.registering(Bundle::class) {
archiveClassifier.set("osgi")
from(tasks.shadowJar.map { zipTree(it.archiveFile) })
+ into("META-INF") {
+ dependencyLicenses(shadedLicenseFiles)
+ }
bundle {
bnd(
""" |
a5f8c40
to
ee4fe84
Compare
…l JARs Signed-off-by: Jorge Solórzano <jorsol@gmail.com>
ee4fe84
to
53c7dd0
Compare
Ok, this should be ready to go. |
All Submissions:
New Feature Submissions:
./gradlew styleCheck
pass ?Changes to Existing Features: