diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2021-04-06 16:22:45 -0500 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2021-04-14 20:03:29 +0000 |
commit | eca5700aeaaa1b3a6c40c77318d33e98a6dd23dd (patch) | |
tree | 5e8dc292e4f2adfac3eaea166e3042b9815ec354 /sonar-application/build.gradle | |
parent | e0a058d7e9dc8cb4dce7b25e01d9702aa3554576 (diff) | |
download | sonarqube-eca5700aeaaa1b3a6c40c77318d33e98a6dd23dd.tar.gz sonarqube-eca5700aeaaa1b3a6c40c77318d33e98a6dd23dd.zip |
SONAR-14676 Shade core jars into a single jar
Diffstat (limited to 'sonar-application/build.gradle')
-rw-r--r-- | sonar-application/build.gradle | 54 |
1 files changed, 30 insertions, 24 deletions
diff --git a/sonar-application/build.gradle b/sonar-application/build.gradle index b1fe29e3c65..31eaad203ff 100644 --- a/sonar-application/build.gradle +++ b/sonar-application/build.gradle @@ -1,5 +1,7 @@ import org.apache.tools.ant.filters.ReplaceTokens +apply plugin: 'com.github.johnrengelman.shadow' + sonarqube { properties { property 'sonar.projectName', "${projectTitle} :: Application" @@ -26,6 +28,16 @@ configurations { } } +jar.enabled = false +shadowJar { + baseName = 'sonar-application' + classifier = null + mergeServiceFiles() + manifest { + attributes('Main-Class': 'org.sonar.application.App') + } +} + dependencies { // please keep list ordered compile 'org.slf4j:slf4j-api' @@ -54,15 +66,6 @@ dependencies { // declare dependencies in configuration bundledPlugin to be packaged in lib/extensions apply from: 'bundled_plugins.gradle' -jar { - manifest { - attributes( - 'Class-Path': configurations.compile.resolvedConfiguration.files.collect { "common/${it.getName()}" }.join(' '), - 'Main-Class': 'org.sonar.application.App' - ) - } -} - task zip(type: Zip, dependsOn: [configurations.compile]) { duplicatesStrategy DuplicatesStrategy.EXCLUDE def archiveDir = "sonarqube-$version" @@ -70,6 +73,7 @@ task zip(type: Zip, dependsOn: [configurations.compile]) { into("${archiveDir}/") { from file('src/main/assembly') exclude 'conf/sonar.properties' + exclude 'conf/wrapper.conf' exclude 'elasticsearch-patch' // elasticsearch script will be replaced by patched version below exclude 'elasticsearch/bin/elasticsearch' @@ -134,16 +138,21 @@ task zip(type: Zip, dependsOn: [configurations.compile]) { into("${archiveDir}/conf/") { from file('src/main/assembly/conf/sonar.properties') - filter(ReplaceTokens, tokens: [ - 'searchDefaultHeapSize': '512MB', - 'searchJavaOpts' : '-Xmx512m -Xms512m -XX:MaxDirectMemorySize=256m -XX:+HeapDumpOnOutOfMemoryError', - 'ceDefaultHeapSize' : '512MB', - 'ceJavaOpts' : '-Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError', - 'webDefaultHeapSize' : '512MB', - 'webJavaOpts' : '-Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError' - ]) - } - + filter(ReplaceTokens, tokens: [ + 'searchDefaultHeapSize': '512MB', + 'searchJavaOpts' : '-Xmx512m -Xms512m -XX:MaxDirectMemorySize=256m -XX:+HeapDumpOnOutOfMemoryError', + 'ceDefaultHeapSize' : '512MB', + 'ceJavaOpts' : '-Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError', + 'webDefaultHeapSize' : '512MB', + 'webJavaOpts' : '-Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError' + ]) + } + into("${archiveDir}/conf/") { + from file('src/main/assembly/conf/wrapper.conf') + filter(ReplaceTokens, tokens: [ + 'sqversion': version + ]) + } into("${archiveDir}/elasticsearch/") { from file('src/main/assembly/elasticsearch-patch') @@ -153,9 +162,6 @@ task zip(type: Zip, dependsOn: [configurations.compile]) { into("${archiveDir}/elasticsearch/") { from "$buildDir/elasticsearch" } - into("${archiveDir}/lib/") { - from jar - } into("${archiveDir}/lib/extensions/") { from configurations.bundledPlugin } @@ -165,8 +171,8 @@ task zip(type: Zip, dependsOn: [configurations.compile]) { into("${archiveDir}/lib/scanner/") { from configurations.scanner } - into("${archiveDir}/lib/common/") { - from configurations.compile + into("${archiveDir}/lib/") { + from shadowJar } into("${archiveDir}/web/") { duplicatesStrategy DuplicatesStrategy.FAIL |