mirror of
https://github.com/mc1arke/sonarqube-community-branch-plugin.git
synced 2024-11-24 08:42:28 +02:00
Cleanup configuration from Gradle 5 migration
The recent migration to Gradle 5 introduced the use of the Shadow plugin in place of the unmaintained SonarQube plugin. However, the default configuration of the Shadow plugin does not bundle dependencies, so the plugin would fail to load if depending on any libraries not bundled with SonarQube. The shadow task is therefore being configured to always execute as part of the Gradle `assemble` task being executed, and it's classifier set to an empty String so it is built/deployed with the same name as the original JAR file. To prevent a clash with the original JAR, its task has been disabled, but it's classifier has also been named as 'nodeps' to make it clear it doesn't contain any dependencies. The shadow plugin has also been updated to the latest version, and the deprecated `layout` syntax used for retrieving SonarQube artifacts replaced with the alternative `patternLayout` syntax, as well as correcting the line endings in `gradlew.bat`.
This commit is contained in:
parent
be05ab603e
commit
7ac2dae96b
17
build.gradle
17
build.gradle
@ -21,7 +21,7 @@ plugins {
|
||||
id('jacoco')
|
||||
id('org.sonarqube') version('2.7')
|
||||
id('info.solidsoft.pitest') version('1.4.0')
|
||||
id('com.github.johnrengelman.shadow') version('4.0.3')
|
||||
id('com.github.johnrengelman.shadow') version('5.1.0')
|
||||
id('net.researchgate.release') version('2.6.0')
|
||||
}
|
||||
|
||||
@ -31,9 +31,9 @@ repositories {
|
||||
mavenCentral()
|
||||
ivy {
|
||||
url 'https://binaries.sonarsource.com/'
|
||||
layout 'pattern', {
|
||||
patternLayout({a ->
|
||||
artifact '/Distribution/[module]/[module]-[revision].[ext]'
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,3 +96,14 @@ release {
|
||||
requireBranch = '(master|release-\\d+\\.\\d+|\\d+\\.\\d+)'
|
||||
}
|
||||
}
|
||||
|
||||
tasks.jar.configure {
|
||||
classifier = 'nodeps'
|
||||
enabled = false
|
||||
}
|
||||
|
||||
tasks.shadowJar.configure {
|
||||
classifier = null
|
||||
}
|
||||
|
||||
assemble.dependsOn('shadowJar')
|
Loading…
Reference in New Issue
Block a user