Add SonarCloud and JaCoCo integration to pom.xml

Configured SonarCloud properties for code analysis and reporting. Integrated JaCoCo Maven plugin to generate code coverage reports in XML format for SonarCloud. These changes enhance code quality metrics and monitoring.
This commit is contained in:
thischwa committed 2025-03-24 10:07:21 +01:00
1 parent 3cd29e4e91
commit efac34e73c
1 file changed
+31
+31
View File
@@ -27,6 +27,12 @@
<project.build.sourceEncoding>${file.encoding}</project.build.sourceEncoding>
<project.reporting.outputEncoding>${file.encoding}</project.reporting.outputEncoding>
<!-- sonarQube cloud -->
<sonar.organization>th-schwarz</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.sourceEncoding>${file.encoding}</sonar.sourceEncoding>
<sonar.test.exclusions>src/test/java/**/*</sonar.test.exclusions>
<!-- checkstyle -->
<checkstyle.version>10.21.3</checkstyle.version>
<checkstyle.plugin.version>3.6.0</checkstyle.plugin.version>
@@ -167,6 +173,31 @@
</dependency>
</dependencies>
</plugin>
<plugin>
<!-- generates the code coverage report for sonar cube -->
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.12</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report-code-coverage</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<formats>XML</formats>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>