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

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


The following commit(s) were added to refs/heads/master by this push:
     new 9addd6c0 ANY23-588 Add code coverage metrics to Sonarcloud.io analysis 
(#276)
9addd6c0 is described below

commit 9addd6c0385f61a11e8059e9c4bfdaf2ef063a58
Author: Lewis John McGibbney <[email protected]>
AuthorDate: Tue Apr 12 10:56:08 2022 -0700

    ANY23-588 Add code coverage metrics to Sonarcloud.io analysis (#276)
---
 .github/workflows/master-build.yml |  6 ++-
 jacoco-report-aggregate/pom.xml    | 84 ++++++++++++++++++++++++++++++++++++++
 pom.xml                            |  6 ++-
 3 files changed, 92 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/master-build.yml 
b/.github/workflows/master-build.yml
index c1377b22..11dfd078 100644
--- a/.github/workflows/master-build.yml
+++ b/.github/workflows/master-build.yml
@@ -54,10 +54,12 @@ jobs:
         if: ${{ github.event_name != 'pull_request' || 
(github.event.pull_request.head.repo.full_name == github.repository && 
github.actor != 'dependabot[bot]') }}
         run: >
           mvn sonar:sonar
-          -Dsonar.projectKey=apache_any23
-          -Dsonar.organization=apache
+          
-Dsonar.coverage.jacoco.xmlReportPaths=jacoco-report-aggregate/target/site/jacoco-aggregate/jacoco.xml
           -Dsonar.host.url=https://sonarcloud.io
           -Dsonar.login=$SONAR_TOKEN
+          -Dsonar.organization=apache
+          -Dsonar.projectKey=apache_any23
+          -Dsonar.verbose=true
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}  # Needed to get PR 
information, if any
           SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
diff --git a/jacoco-report-aggregate/pom.xml b/jacoco-report-aggregate/pom.xml
new file mode 100644
index 00000000..0a0233a9
--- /dev/null
+++ b/jacoco-report-aggregate/pom.xml
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <artifactId>apache-any23</artifactId>
+    <groupId>org.apache.any23</groupId>
+    <version>2.8-SNAPSHOT</version>
+    <relativePath>../</relativePath>
+  </parent>
+
+  <artifactId>jacoco-report-aggregate</artifactId>
+ 
+  <name>Apache Any23 :: JaCoCo Report Aggregate</name>
+  <description>Special Maven module containing nothing except a pom.xml that 
uses the JaCoCo report-aggregate goal.</description>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.any23</groupId>
+      <artifactId>apache-any23-api</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.any23</groupId>
+      <artifactId>apache-any23-cli</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.any23</groupId>
+      <artifactId>apache-any23-core</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.any23</groupId>
+      <artifactId>apache-any23-csvutils</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.any23</groupId>
+      <artifactId>apache-any23-encoding</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.any23</groupId>
+      <artifactId>apache-any23-mime</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.jacoco</groupId>
+        <artifactId>jacoco-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>report-aggregate</id>
+            <phase>verify</phase>
+            <goals>
+              <goal>report-aggregate</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>
diff --git a/pom.xml b/pom.xml
index b5b24640..0c535e8d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -231,6 +231,7 @@
     <module>encoding</module>
     <module>core</module>
     <module>cli</module>
+    <module>jacoco-report-aggregate</module>
   </modules>
 
   <scm>
@@ -324,7 +325,7 @@
     <formatter-maven-plugin.version>2.18.0</formatter-maven-plugin.version>
     <ossindex-maven-plugin.version>3.2.0</ossindex-maven-plugin.version>
     <maven-enforcer-plugin.version>3.0.0</maven-enforcer-plugin.version>
-    <jacoco-maven-plugin.version>0.8.7</jacoco-maven-plugin.version>
+    <jacoco-maven-plugin.version>0.8.8</jacoco-maven-plugin.version>
 
     <!--
      | Any23 website has to be stored in SVN
@@ -340,7 +341,8 @@
     <sonar.host.url>https://sonarcloud.io</sonar.host.url>
     <sonar.sourceEncoding>UTF-8</sonar.sourceEncoding>
     <sonar.projectVersion>${project.version}</sonar.projectVersion>
-    
<sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/target/site/jacoco/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
+    
<sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/jacoco-report-aggregate/target/site/
+      jacoco-aggregate/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
   </properties>
 
   <dependencyManagement>

Reply via email to