1414 */
1515
1616
17+ import com.github.jk1.license.filter.LicenseBundleNormalizer
1718import groovy.transform.CompileStatic
1819import groovy.transform.Memoized
1920import net.ltgt.gradle.errorprone.CheckSeverity
@@ -24,7 +25,7 @@ import java.util.regex.Pattern
2425plugins {
2526 id ' com.diffplug.spotless' version ' 6.23.3'
2627 id ' com.github.ben-manes.versions' version ' 0.50.0'
27- id ' com.github.hierynomus. license' version ' 0.16.1-fix '
28+ id ' com.github.jk1.dependency- license-report ' version ' 2.5 '
2829 id ' com.jfrog.artifactory' version ' 5.1.11'
2930 id ' io.spring.dependency-management' version ' 1.1.4'
3031 id ' me.champeau.jmh' version ' 0.7.2' apply false
@@ -87,13 +88,33 @@ def _strListCmdArg(name) {
8788 return _strListCmdArg(name, null )
8889}
8990
91+ licenseReport {
92+ // This is for the allowed-licenses-file in checkLicense Task
93+ // Accepts File, URL or String path to local or remote file
94+ allowedLicensesFile = new File (" $rootDir /gradle/allowed-licenses.json" )
95+
96+ excludes = [
97+ // only used for static analysis, not actually shipped
98+ ' com.google.errorprone:javac' ,
99+ ' org.checkerframework:dataflow-shaded' ,
100+ ' org.checkerframework:dataflow-errorprone' ,
101+ // exclude Kotlin multiplatform dependencies container, they have the same license of what they contain
102+ ' com.squareup.okio:okio' ,
103+ ' org.jetbrains.kotlinx:kotlinx-coroutines-core'
104+ ]
105+
106+ // If set to true, then all boms will be excluded from the report
107+ excludeBoms = true
108+
109+ filters = [new LicenseBundleNormalizer (bundlePath : " $rootDir /gradle/license-normalizer-bundle.json" )]
110+ }
111+
90112allprojects {
91113 apply plugin : ' java-library'
92114 apply plugin : ' io.spring.dependency-management'
93115 apply plugin : ' jacoco'
94116 apply plugin : ' net.ltgt.errorprone'
95117 apply from : " ${ rootDir} /gradle/versions.gradle"
96- apply from : " ${ rootDir} /gradle/check-licenses.gradle"
97118
98119 version = rootProject. version
99120
@@ -623,10 +644,10 @@ task autocomplete(type: JavaExec) {
623644 }
624645}
625646
626- installDist { dependsOn checkLicenses , untunedStartScripts, evmToolStartScripts }
647+ installDist { dependsOn checkLicense , untunedStartScripts, evmToolStartScripts }
627648
628649distTar {
629- dependsOn checkLicenses , autocomplete, untunedStartScripts, evmToolStartScripts
650+ dependsOn checkLicense , autocomplete, untunedStartScripts, evmToolStartScripts
630651 doFirst {
631652 delete fileTree(dir : ' build/distributions' , include : ' *.tar.gz' )
632653 }
@@ -635,7 +656,7 @@ distTar {
635656}
636657
637658distZip {
638- dependsOn checkLicenses , autocomplete, untunedStartScripts, evmToolStartScripts
659+ dependsOn checkLicense , autocomplete, untunedStartScripts, evmToolStartScripts
639660 doFirst {
640661 delete fileTree(dir : ' build/distributions' , include : ' *.zip' )
641662 }
0 commit comments