This is an automated email from the ASF dual-hosted git repository.
claude pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/creadur-rat.git
The following commit(s) were added to refs/heads/master by this push:
new d6de929e RAT-293: Generate coverage report via SonarCloud (#603)
d6de929e is described below
commit d6de929e7c8f6a5f8b45ac7927e3f8ed0f3ba7db
Author: P. Ottlinger <[email protected]>
AuthorDate: Tue Jan 6 10:57:04 2026 +0100
RAT-293: Generate coverage report via SonarCloud (#603)
* RAT-293: Generate a coverage report via SonarCloud
* RAT-293: Update dependencies in SonarCloud action workflow
* RAT-293: Enable code coverage with jacoco
* RAT-293: Cleanup config in reporting section and pluginManagement section
---
.github/workflows/sonarcloud.yml | 10 ++++----
pom.xml | 54 +++++++++++++++++++++++++++++++++++++++-
src/changes/changes.xml | 2 +-
3 files changed, 59 insertions(+), 7 deletions(-)
diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml
index f8dd0660..f0ab2032 100644
--- a/.github/workflows/sonarcloud.yml
+++ b/.github/workflows/sonarcloud.yml
@@ -10,16 +10,16 @@ jobs:
name: Build and analyze
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
with:
fetch-depth: 0 # Shallow clones should be disabled for a better
relevancy of analysis
- - name: Set up JDK 17
- uses: actions/setup-java@v4
+ - name: Set up JDK17
+ uses: actions/setup-java@v5
with:
- java-version: 17
+ java-version: '17'
distribution: 'zulu' # Alternative distribution options are
available.
- name: Cache SonarQube packages
- uses: actions/cache@v4
+ uses: actions/cache@v5
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
diff --git a/pom.xml b/pom.xml
index 66bda89b..058beba4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -455,6 +455,34 @@ agnostic home for software distribution comprehension and
audit tools.
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
</plugin>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <!-- select non-aggregate reports -->
+ <report>report</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ <configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>report</id>
+ <phase>test</phase>
+ <goals>
+ <goal>report</goal>
+ </goals>
+ </execution>
+ </executions>
+ </configuration>
+ </plugin>
</plugins>
</reporting>
<build>
@@ -647,7 +675,8 @@ agnostic home for software distribution comprehension and
audit tools.
<version>3.5.4</version>
<configuration>
<forkCount>1</forkCount>
- <argLine>-Dfile.encoding=ISO-8859-1</argLine>
+ <!-- RAT-293: We need to append to the existing arguments in order
for code coverage to work -->
+ <argLine>${argLine} -Dfile.encoding=ISO-8859-1</argLine>
</configuration>
</plugin>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself.-->
@@ -692,6 +721,25 @@ agnostic home for software distribution comprehension and
audit tools.
<artifactId>maven-clean-plugin</artifactId>
<version>3.4.1</version>
</plugin>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <version>0.8.14</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>report</id>
+ <phase>test</phase>
+ <goals>
+ <goal>report</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
@@ -808,6 +856,10 @@ agnostic home for software distribution comprehension and
audit tools.
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
</plugin>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ </plugin>
</plugins>
<extensions>
<extension>
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 350ddf29..bd6a75f3 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -69,7 +69,7 @@ in order to be properly linked in site reports.
-->
<release version="1.0.0" date="xxxx-yy-zz" description="Current SNAPSHOT -
release to be done">
<action issue="RAT-293" type="add" dev="pottlinger">
- Add integration of RAT into SonarCloud analysis now that JDK8 is
dropped.
+ Add integration of RAT into SonarCloud analysis now that JDK8 is
dropped and generate a test coverage report with JaCoCo.
</action>
<action issue="RAT-478" type="add" dev="pottlinger">
Due to the switch to Java17 language level we use UTF-8 as default
charset to process configuration and exclusion configuration files within RAT.