From: Zipeng WU Date: Fri, 22 Oct 2021 13:40:57 +0000 (+0200) Subject: SONAR-15485 Generate license info in community distribution X-Git-Tag: 8.9.4.50575~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c68b8c268ef510cecdf7bbacdf6b2fa2852b3485;p=sonarqube.git SONAR-15485 Generate license info in community distribution --- diff --git a/build.gradle b/build.gradle index 43bbddf4773..a48bcd5cf19 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,7 @@ plugins { // Ordered alphabeticly id 'com.github.ben-manes.versions' version '0.33.0' id 'com.github.hierynomus.license' version '0.15.0' + id "com.github.hierynomus.license-report" version"0.15.0" apply false id 'com.github.johnrengelman.shadow' version '5.2.0' apply false id 'com.google.protobuf' version '0.8.13' apply false id 'com.jfrog.artifactory' version '4.21.0' diff --git a/sonar-application/build.gradle b/sonar-application/build.gradle index f1bcd3aaae4..2d84c89e269 100644 --- a/sonar-application/build.gradle +++ b/sonar-application/build.gradle @@ -1,6 +1,9 @@ import org.apache.tools.ant.filters.ReplaceTokens -apply plugin: 'com.github.johnrengelman.shadow' +plugins { + id "com.github.hierynomus.license-report" + id "com.github.johnrengelman.shadow" +} sonarqube { properties { @@ -26,6 +29,8 @@ configurations { bundledPlugin { transitive = false } + + appLicenses.extendsFrom(compile, web, scanner, jsw, jdbc_mssql, jdbc_postgresql, jdbc_h2) } jar.enabled = false @@ -66,11 +71,18 @@ dependencies { // declare dependencies in configuration bundledPlugin to be packaged in lib/extensions apply from: 'bundled_plugins.gradle' -task zip(type: Zip, dependsOn: [configurations.compile]) { +downloadLicenses { + dependencyConfiguration = 'appLicenses' +} + +task zip(type: Zip, dependsOn: [configurations.compile, tasks.downloadLicenses]) { duplicatesStrategy DuplicatesStrategy.EXCLUDE def archiveDir = "sonarqube-$version" into("${archiveDir}/") { + from(tasks.downloadLicenses.outputs) { + include 'dependency-license.json' + } from file('src/main/assembly') exclude 'conf/sonar.properties' exclude 'conf/wrapper.conf'