Skip to content

Commit

Permalink
[sonar] Update Sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
pdulth committed Mar 6, 2024
1 parent a00ee15 commit ccf4b7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vars/sonar.groovy
@@ -1,10 +1,10 @@


def runSonar(String sonarProjectKey, String githubRepository, String sonarLoginToken, javaVersion = "8"){
def runSonar(String sonarProjectKey, String githubRepository, String sonarLoginToken, javaVersion = "17"){
withCredentials([string(credentialsId: "${sonarLoginToken}", variable: 'SONARCLOUD_TOKEN')]) {
withEnv(['MAVEN_OPTS=-Xmx4g']) {
def jacocoParameters = "-Dsonar.java.coveragePlugin=jacoco -Dsonar.core.codeCoveragePlugin=jacoco "
def sonarCommon = "sonar:sonar -Dsonar.projectKey=${sonarProjectKey} -Dsonar.organization=eclipse -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${SONARCLOUD_TOKEN} -Dsonar.skipDesign=true -Dsonar.dynamic=reuseReports -Dsonar.java.source=${javaVersion} -Dsonar.scanner.force-deprecated-java-version=true "
def sonarCommon = "sonar:sonar -Dsonar.projectKey=${sonarProjectKey} -Dsonar.organization=eclipse-capella -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${SONARCLOUD_TOKEN} -Dsonar.skipDesign=true -Dsonar.dynamic=reuseReports -Dsonar.java.source=${javaVersion} -Dsonar.scanner.force-deprecated-java-version=true "
def sonarBranchAnalysis = "-Dsonar.branch.name=${BRANCH_NAME}"
def sonarPullRequestAnalysis = (github.isPullRequest() ? "-Dsonar.pullrequest.provider=GitHub -Dsonar.pullrequest.github.repository=${githubRepository} -Dsonar.pullrequest.key=${CHANGE_ID} -Dsonar.pullrequest.branch=${CHANGE_BRANCH}" : "")
def sonar = sonarCommon + jacocoParameters + (github.isPullRequest() ? sonarPullRequestAnalysis : sonarBranchAnalysis)
Expand Down

0 comments on commit ccf4b7f

Please sign in to comment.