@@ -5,8 +5,11 @@ plugins {
5
5
id " de.marcphilipp.nexus-publish" version " 0.3.0"
6
6
id " com.github.johnrengelman.shadow" version " 5.2.0"
7
7
id " org.cyclonedx.bom" version " 1.8.2"
8
+ id ' com.github.jk1.dependency-license-report' version ' 1.17'
8
9
}
9
10
11
+ import com.github.jk1.license.render.TextReportRenderer
12
+
10
13
if (project. hasProperty(' isTagTriggered' )) {
11
14
version = getAbbreviatedGitVersion()
12
15
} else {
@@ -29,6 +32,10 @@ spotless {
29
32
}
30
33
}
31
34
35
+ licenseReport {
36
+ renderers = [new TextReportRenderer (' THIRD-PARTY-LICENSE.txt' )]
37
+ }
38
+
32
39
cyclonedxBom {
33
40
// includeConfigs is the list of configuration names to include when generating the BOM (leave empty to include every configuration), regex is supported
34
41
includeConfigs = [" runtimeClasspath" ]
@@ -102,8 +109,6 @@ allprojects {
102
109
testCompile group : ' org.mockito' , name : ' mockito-junit-jupiter' , version : mockitoVersion
103
110
}
104
111
105
- // ant.lifecycleLogLevel = AntBuilder.AntMessagePriority.VERBOSE
106
-
107
112
compileJava {
108
113
doLast {
109
114
ant. taskdef(resource : " org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties" ,
@@ -214,12 +219,30 @@ task runCallbackWithBadRefreshToken(type: JavaExec) {
214
219
}
215
220
216
221
jar {
222
+ // Add the THIRD-PARTY-LICENSE to our jar
223
+ // Note that in order for this to work, the file must be present
224
+ // To generate it, run generateLicenseReport. However, ':generateLicenseReport' has a dependecy on `:jar`
225
+ // which makes it impossible to generate and bundle the THIRD-PARTY-LICENSE in one pass.
226
+ from(' build/reports/dependency-license/THIRD-PARTY-LICENSE.txt' ) {
227
+ into ' META-INF/licenses'
228
+ }
229
+
217
230
manifest {
218
231
attributes(' Implementation-Title' : project. name,
219
232
' Implementation-Version' : project. version)
220
233
}
221
234
}
222
235
236
+ shadowJar {
237
+ // Add the THIRD-PARTY-LICENSE to our jar
238
+ // Note that in order for this to work, the file must be present
239
+ // To generate it, run generateLicenseReport. However, ':generateLicenseReport' has a dependecy on `:jar`
240
+ // which makes it impossible to generate and bundle the THIRD-PARTY-LICENSE in one pass.
241
+ from(' build/reports/dependency-license/THIRD-PARTY-LICENSE.txt' ) {
242
+ into ' META-INF/licenses'
243
+ }
244
+ }
245
+
223
246
dependencies {
224
247
integrationTestImplementation " org.yaml:snakeyaml:$snakeYamlVersion "
225
248
api " org.mongodb:mongodb-driver-sync:$mongodbDriverVersion "
0 commit comments