[AMQ-9539] Add sonar quality analysis to Jenkins

This commit is contained in:
Matt Pavlovich 2024-07-23 16:43:33 -05:00 committed by Matt Pavlovich
parent 6b6f5fbe24
commit 03a9771fe4
2 changed files with 15 additions and 0 deletions

9
Jenkinsfile vendored
View File

@ -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.

View File

@ -144,6 +144,7 @@
<taglist-maven-plugin-version>3.0.0</taglist-maven-plugin-version>
<build-helper-maven-plugin-version>3.5.0</build-helper-maven-plugin-version>
<replacer-maven-plugin-version>1.5.3</replacer-maven-plugin-version>
<sonar-maven-plugin-version>4.0.0.4121</sonar-maven-plugin-version>
<apache-rat-plugin-version>0.16.1</apache-rat-plugin-version>
<tools-maven-plugin-version>1.4</tools-maven-plugin-version>
<depends-maven-plugin-version>1.5.0</depends-maven-plugin-version>
@ -1150,6 +1151,11 @@
<artifactId>replacer</artifactId>
<version>${replacer-maven-plugin-version}</version>
</plugin>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>${sonar-maven-plugin-version}</version>
</plugin>
<!--This plugin's configuration is used to store Eclipse m2e settings only.
It has no influence on the Maven build itself.-->
<plugin>