From 03a9771fe48415f0782c8330b6625567f454b561 Mon Sep 17 00:00:00 2001 From: Matt Pavlovich Date: Tue, 23 Jul 2024 16:43:33 -0500 Subject: [PATCH] [AMQ-9539] Add sonar quality analysis to Jenkins --- Jenkinsfile | 9 +++++++++ pom.xml | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 01bf07c935..55f7e3e6a5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -44,6 +44,7 @@ pipeline { parameters { choice(name: 'nodeLabel', choices: ['ubuntu', 's390x', 'arm', 'Windows']) choice(name: 'jdkVersion', choices: ['jdk_17_latest', 'jdk_21_latest', 'jdk_22_latest', 'jdk_17_latest_windows', 'jdk_21_latest_windows', 'jdk_22_latest_windows']) + booleanParam(name: 'sonarEnabled', defaultValue: false) } stages { @@ -153,6 +154,14 @@ pipeline { sh 'mvn -B -e deploy -Pdeploy -DskipTests' } } + + stage('Quality') { + when { expression { return params.sonarEnabled } } + steps { + sh 'echo "Running the Sonar stage"' + } + } + } // Do any post build stuff ... such as sending emails depending on the overall build result. diff --git a/pom.xml b/pom.xml index 804df48b7e..b53f130248 100644 --- a/pom.xml +++ b/pom.xml @@ -144,6 +144,7 @@ 3.0.0 3.5.0 1.5.3 + 4.0.0.4121 0.16.1 1.4 1.5.0 @@ -1150,6 +1151,11 @@ replacer ${replacer-maven-plugin-version} + + org.sonarsource.scanner.maven + sonar-maven-plugin + ${sonar-maven-plugin-version} +