This is an automated email from the ASF dual-hosted git repository.

jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git


The following commit(s) were added to refs/heads/master by this push:
     new 493c84d60a SonarQube bug fixes
493c84d60a is described below

commit 493c84d60a7c1d2c6b41e8c5265caf6b2806c29d
Author: James Bognar <[email protected]>
AuthorDate: Tue Feb 3 18:55:54 2026 -0500

    SonarQube bug fixes
---
 .github/workflows/sonarcloud.yml | 10 +++++++++-
 pom.xml                          | 35 +++++++++++++++++++++++++++++++++++
 sonar-project.properties         |  7 ++++++-
 3 files changed, 50 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml
index d46301447d..0707bf6fba 100644
--- a/.github/workflows/sonarcloud.yml
+++ b/.github/workflows/sonarcloud.yml
@@ -50,4 +50,12 @@ jobs:
         env:
           SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}  # Needed to get PR 
information, if any
-        run: mvn -B verify 
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar 
-Dsonar.projectKey=apache_juneau -Dsonar.organization=apache 
-Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN
+        run: |
+          # Build with tests and coverage
+          mvn -B clean verify
+          # Run SonarCloud analysis (it will auto-detect JaCoCo reports)
+          mvn -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
+            -Dsonar.projectKey=apache_juneau \
+            -Dsonar.organization=apache \
+            -Dsonar.host.url=https://sonarcloud.io \
+            -Dsonar.login=$SONAR_TOKEN
diff --git a/pom.xml b/pom.xml
index c2cd39b67b..517925afde 100644
--- a/pom.xml
+++ b/pom.xml
@@ -73,6 +73,26 @@
        <build>
                <defaultGoal>clean verify</defaultGoal>
                <plugins>
+                       <plugin>
+                               <groupId>org.jacoco</groupId>
+                               <artifactId>jacoco-maven-plugin</artifactId>
+                               <version>${jacoco.plugin.version}</version>
+                               <executions>
+                                       <execution>
+                                               <id>prepare-agent</id>
+                                               <goals>
+                                                       
<goal>prepare-agent</goal>
+                                               </goals>
+                                       </execution>
+                                       <execution>
+                                               <id>report</id>
+                                               <phase>test</phase>
+                                               <goals>
+                                                       <goal>report</goal>
+                                               </goals>
+                                       </execution>
+                               </executions>
+                       </plugin>
                        <plugin>
                                <artifactId>maven-enforcer-plugin</artifactId>
                                <executions>
@@ -224,6 +244,21 @@
                                        <groupId>org.jacoco</groupId>
                                        
<artifactId>jacoco-maven-plugin</artifactId>
                                        
<version>${jacoco.plugin.version}</version>
+                                       <executions>
+                                               <execution>
+                                                       <id>prepare-agent</id>
+                                                       <goals>
+                                                               
<goal>prepare-agent</goal>
+                                                       </goals>
+                                               </execution>
+                                               <execution>
+                                                       <id>report</id>
+                                                       <phase>test</phase>
+                                                       <goals>
+                                                               
<goal>report</goal>
+                                                       </goals>
+                                               </execution>
+                                       </executions>
                                </plugin>
 
                                <plugin>
diff --git a/sonar-project.properties b/sonar-project.properties
index 23c6f8d277..d98870784a 100644
--- a/sonar-project.properties
+++ b/sonar-project.properties
@@ -34,7 +34,12 @@ 
sonar.exclusions=**/target/**,**/doc/**,**/examples/**,**/src/main/resources/**,
 
sonar.test.exclusions=**/target/**,**/doc/**,**/examples/**,**/generated/**,**/build/**
 
 # Coverage configuration
-# SonarQube will search for JaCoCo reports in all modules
+# SonarCloud will auto-detect JaCoCo reports if they're in standard locations
+# For multi-module projects, SonarCloud can use either:
+# 1. Individual module execution data files: **/target/jacoco.exec
+# 2. XML reports: **/target/site/jacoco/jacoco.xml
+# 3. Aggregate report (from juneau-utest): 
**/target/site/jacoco-aggregate/jacoco.xml
+# SonarCloud will automatically find these if they exist, but we can 
explicitly specify them:
 
sonar.coverage.jacoco.xmlReportPaths=**/target/site/jacoco-aggregate/jacoco.xml,**/target/site/jacoco/jacoco.xml
 sonar.junit.reportPaths=**/target/surefire-reports
 

Reply via email to