Skip to content
Permalink
Browse files
remove duplicate entries in jars warnings
  • Loading branch information
paulk-asert committed Apr 14, 2022
1 parent 362469f commit 90ec9d2652ee2a88b8d7e58df09a96e7304bf58b
Showing 2 changed files with 16 additions and 14 deletions.
@@ -183,7 +183,7 @@ configurations {

allprojects {
tasks.withType(AbstractCopyTask).configureEach {
it.duplicatesStrategy = DuplicatesStrategy.WARN
it.duplicatesStrategy = DuplicatesStrategy.FAIL
}
}

@@ -198,6 +198,7 @@ tasks.named('jar') {
from("$projectDir/notices/NOTICE-JARJAR")
rename '^([A-Z]+)-([^.]*)', '$1'
}
exclude '**/package-info.class'
}


@@ -149,25 +149,26 @@ tasks.withType(AbstractArchiveTask) {
reproducibleFileOrder = true
}

tasks.withType(Jar).configureEach {
tasks.withType(Jar).configureEach {jar ->
metaInf {
if (file("${projectDir}/LICENSE").exists()) {
from "${projectDir}/LICENSE"
} else {
from("${rootProject.projectDir}/licenses/LICENSE-BASE") {
rename 'LICENSE-BASE', 'LICENSE'
if (jar.name == 'sourcesJar') {
if (file("${projectDir}/LICENSE").exists()) {
from "${projectDir}/LICENSE"
} else {
from("${rootProject.projectDir}/licenses/LICENSE-BASE") {
rename 'LICENSE-BASE', 'LICENSE'
}
}
}
if (file("${projectDir}/NOTICE").exists()) {
from "${projectDir}/NOTICE"
} else {
from("${rootProject.projectDir}/notices/NOTICE-BASE") {
rename 'NOTICE-BASE', 'NOTICE'
if (file("${projectDir}/NOTICE").exists()) {
from "${projectDir}/NOTICE"
} else {
from("${rootProject.projectDir}/notices/NOTICE-BASE") {
rename 'NOTICE-BASE', 'NOTICE'
}
}
}
from generateReleaseInfo
}
exclude '**/package-info.class'
}

tasks.register("jarjar", JarJarTask) {

0 comments on commit 90ec9d2

Please sign in to comment.