Update SonarCloud integration to use Maven plugin
Replaced Sonar Scanner CLI with Maven Sonar plugin in the CI workflow for better integration and simplicity. Added SonarCloud configuration properties to `pom.xml` for centralized management. This streamlines the setup and ensures consistency across the project.
This commit is contained in:
+2
-13
@@ -45,20 +45,9 @@ sonarcloud_scan:
|
|||||||
stage: sonarcloud_scan
|
stage: sonarcloud_scan
|
||||||
dependencies:
|
dependencies:
|
||||||
- build
|
- build
|
||||||
image:
|
|
||||||
name: sonarsource/sonar-scanner-cli:latest
|
|
||||||
entrypoint: [ "" ]
|
|
||||||
script:
|
script:
|
||||||
- |
|
- mvn verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
|
||||||
sonar-scanner \
|
-Dsonar.projectKey=thischwa_CloudflareDNS-java
|
||||||
-Dsonar.projectKey=${SONAR_PROJECT_KEY} \
|
|
||||||
-Dsonar.organization=${SONAR_ORGANIZATION} \
|
|
||||||
-Dsonar.token=${SONAR_TOKEN} \
|
|
||||||
-Dsonar.branch.name=develop \
|
|
||||||
-Dsonar.projectBaseDir=${CI_PROJECT_DIR} \
|
|
||||||
-Dsonar.tests=src/test/java \
|
|
||||||
-Dsonar.exclusions=docs/** \
|
|
||||||
-Dsonar.java.binaries=target/classes
|
|
||||||
only:
|
only:
|
||||||
- merge_requests
|
- merge_requests
|
||||||
- develop
|
- develop
|
||||||
|
|||||||
@@ -39,6 +39,10 @@
|
|||||||
<slf4j.version>2.0.17</slf4j.version>
|
<slf4j.version>2.0.17</slf4j.version>
|
||||||
<logback-classic.version>1.5.18</logback-classic.version>
|
<logback-classic.version>1.5.18</logback-classic.version>
|
||||||
<junit5.version>5.11.4</junit5.version>
|
<junit5.version>5.11.4</junit5.version>
|
||||||
|
|
||||||
|
<!-- sonarqube -->
|
||||||
|
<sonar.organization>thischwa</sonar.organization>
|
||||||
|
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<scm>
|
<scm>
|
||||||
|
|||||||
Reference in New Issue
Block a user