SonarCloud add-on to gradle

This commit is contained in:
Rsl1122 2018-12-19 19:24:33 +02:00
parent 4c7636b0c2
commit 36ee6e00db
2 changed files with 11 additions and 1 deletions

View File

@ -1,5 +1,7 @@
plugins {
id "java"
id "jacoco"
id "org.sonarqube" version "2.2"
id "net.ltgt.apt" version "0.19"
id "com.github.johnrengelman.shadow" version "4.0.2"
}
@ -16,6 +18,7 @@ subprojects {
apply plugin: "maven"
apply plugin: "net.ltgt.apt"
apply plugin: "com.github.johnrengelman.shadow"
apply plugin: "jacoco"
sourceCompatibility = 1.8
targetCompatibility = 1.8
@ -104,4 +107,11 @@ subprojects {
artifacts {
testArtifacts testJar
}
}
sonarqube {
properties {
property "sonar.projectName", "Java Gradle-based project analyzed on SonarCloud using Travis"
property "sonar.projectKey", "com.sonarqube.examples.java-gradle-travis-project"
}
}

View File

@ -7,5 +7,5 @@ if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
fi
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
mvn org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar
gradle sonarqube
fi