You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2022/06/20 16:29:41 UTC
[sling-tooling-jenkins] 01/01: SLING-11400 enable jacoco with the main Maven build
This is an automated email from the ASF dual-hosted git repository.
kwin pushed a commit to branch bugfix/fix-jacoco-execution
in repository https://gitbox.apache.org/repos/asf/sling-tooling-jenkins.git
commit a0196b1df1d9e8ff0a7c8fbd31f8da564cc83a20
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Mon Jun 20 18:29:33 2022 +0200
SLING-11400 enable jacoco with the main Maven build
---
vars/slingOsgiBundleBuild.groovy | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/vars/slingOsgiBundleBuild.groovy b/vars/slingOsgiBundleBuild.groovy
index 1b97856..021b541 100644
--- a/vars/slingOsgiBundleBuild.groovy
+++ b/vars/slingOsgiBundleBuild.groovy
@@ -148,8 +148,8 @@ def defineStage(def globalConfig, def jobConfig, def jdkVersion, boolean isRefer
dir(localRepoPath) {
deleteDir()
}
- // deploy to local directory (all artifacts from a reactor)
- additionalMavenParams = "${additionalMavenParams} -DaltDeploymentRepository=snapshot-repo::default::file:${localRepoPath}"
+ // deploy to local directory (all artifacts from a reactor) and calculate coverage with jacoco (for subsequent evaluation by SonarQube)
+ additionalMavenParams = "${additionalMavenParams} -DaltDeploymentRepository=snapshot-repo::default::file:${localRepoPath} -Pjacoco-report"
}
checkout scm
withMaven(maven: globalConfig.mvnVersion, jdk: jenkinsJdkLabel,
@@ -204,7 +204,7 @@ def analyseWithSonarCloud(def globalConfig, def jobConfig) {
def isPrBuild = env.BRANCH_NAME.startsWith("PR-")
// As we don't have the global SonarCloud conf for now, we can't use #withSonarQubeEnv so we need to set the following props manually
- def sonarcloudParams="-Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=apache -Dsonar.projectKey=apache_${jobConfig.repoName} -Pjacoco-report -Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco-merged/jacoco.xml ${jobConfig.sonarQubeAdditionalParams}"
+ def sonarcloudParams="-Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=apache -Dsonar.projectKey=apache_${jobConfig.repoName} -Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco-merged/jacoco.xml ${jobConfig.sonarQubeAdditionalParams}"
if ( jobConfig.sonarQubeUseAdditionalMavenParams ) {
sonarcloudParams="${sonarcloudParams} ${additionalMavenParams}"
}