You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by kw...@apache.org on 2023/07/11 10:02:11 UTC

[jackrabbit-filevault] branch master updated: Fix coverage after separation of ITs

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

kwin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault.git


The following commit(s) were added to refs/heads/master by this push:
     new 43ac1605 Fix coverage after separation of ITs
43ac1605 is described below

commit 43ac160511b7c0ec5938413057924863b5e40191
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Tue Jul 11 12:02:06 2023 +0200

    Fix coverage after separation of ITs
    
    minor cleanup
---
 .ratignore                                    |   1 +
 README.md                                     |   8 +-
 parent/pom.xml                                |  27 +-----
 pom.xml                                       |  15 ++++
 vault-core-it/vault-core-it-execution/pom.xml |   2 +-
 vault-core/pom.xml                            |  21 -----
 vault-coverage-aggregate/pom.xml              | 122 ++++++++++++++++++++++++++
 vault-hook-example/pom.xml                    |   4 +
 vault-hook-externalclass-test/pom.xml         |   4 +
 9 files changed, 152 insertions(+), 52 deletions(-)

diff --git a/.ratignore b/.ratignore
new file mode 100644
index 00000000..d9975951
--- /dev/null
+++ b/.ratignore
@@ -0,0 +1 @@
+vault-coverage-aggregate/**
\ No newline at end of file
diff --git a/README.md b/README.md
index e34462ae..fff0d6f6 100644
--- a/README.md
+++ b/README.md
@@ -2,10 +2,10 @@
 ![GitHub](https://img.shields.io/github/license/apache/jackrabbit-filevault)
 [![Maven Central](https://img.shields.io/maven-central/v/org.apache.jackrabbit.vault/vault-cli.svg?label=Maven%20Central)](https://search.maven.org/artifact//org.apache.jackrabbit.vault/vault-cli)
 [![Build Status](https://ci-builds.apache.org/buildStatus/icon?job=Jackrabbit%2Ffilevault%2Fmaster)](https://ci-builds.apache.org/job/Jackrabbit/job/filevault/job/master/)
-[![SonarCloud Status](https://sonarcloud.io/api/project_badges/measure?project=apache_jackrabbit-filevault&metric=alert_status)](https://sonarcloud.io/dashboard?id=apache_jackrabbit-filevault)
-[![SonarCloud Coverage](https://sonarcloud.io/api/project_badges/measure?project=apache_jackrabbit-filevault&metric=coverage)](https://sonarcloud.io/component_measures/metric/coverage/list?id=apache_jackrabbit-filevault)
-[![SonarCloud Bugs](https://sonarcloud.io/api/project_badges/measure?project=apache_jackrabbit-filevault&metric=bugs)](https://sonarcloud.io/component_measures/metric/reliability_rating/list?id=apache_jackrabbit-filevault)
-[![SonarCloud Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=apache_jackrabbit-filevault&metric=vulnerabilities)](https://sonarcloud.io/component_measures/metric/security_rating/list?id=apache_jackrabbit-filevault)
+[![SonarCloud Status](https://sonarcloud.io/api/project_badges/measure?project=apache_jackrabbit-filevault&metric=alert_status)](https://sonarcloud.io/summary/overall?id=apache_jackrabbit-filevault)
+[![SonarCloud Coverage](https://sonarcloud.io/api/project_badges/measure?project=apache_jackrabbit-filevault&metric=coverage)](https://sonarcloud.io/component_measures?metric=Coverage&view=list&id=apache_jackrabbit-filevault)
+[![SonarCloud Bugs](https://sonarcloud.io/api/project_badges/measure?project=apache_jackrabbit-filevault&metric=bugs)](https://sonarcloud.io/project/issues?resolved=false&types=BUG&id=apache_jackrabbit-filevault)
+[![SonarCloud Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=apache_jackrabbit-filevault&metric=vulnerabilities)](https://sonarcloud.io/project/issues?resolved=false&types=VULNERABILITY&id=apache_jackrabbit-filevault)
 
 Welcome to Apache Jackrabbit FileVault
 ===========================================================
diff --git a/parent/pom.xml b/parent/pom.xml
index 5bfd6602..062e46ce 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -62,7 +62,7 @@ Apache Jackrabbit FileVault is a project of the Apache Software Foundation.
         <minimalMavenBuildVersion>3.6.1</minimalMavenBuildVersion><!-- due to https://issues.apache.org/jira/browse/MNG-6059 -->
         <minimalJavaBuildVersion>11</minimalJavaBuildVersion>
         <maven.compiler.release>8</maven.compiler.release>
-        <surefire.version>3.0.0-M7</surefire.version>
+        <surefire.version>3.1.2</surefire.version>
         <sling.url>http://localhost:4502</sling.url>
         <jacoco.command /><!-- is overwritten by https://www.eclemma.org/jacoco/trunk/doc/prepare-agent-mojo.html -->
         <project.build.outputTimestamp>2023-01-05T15:25:16Z</project.build.outputTimestamp>
@@ -574,31 +574,6 @@ Bundle-Category: jackrabbit
                                     <append>true</append>
                                 </configuration>
                             </execution>
-                            <execution>
-                                <id>merge-unit-and-it</id>
-                                <phase>post-integration-test</phase>
-                                <goals>
-                                    <goal>merge</goal>
-                                </goals>
-                                <configuration>
-                                    <fileSets>
-                                        <fileSet>
-                                            <directory>${project.build.directory}</directory>
-                                            <includes>
-                                                <include>jacoco-unit.exec</include>
-                                                <include>jacoco-it.exec</include>
-                                            </includes>
-                                        </fileSet>
-                                    </fileSets>
-                                </configuration>
-                            </execution>
-                            <execution>
-                                <id>report-merged</id>
-                                <phase>verify</phase>
-                                <goals>
-                                    <goal>report</goal>
-                                </goals>
-                            </execution>
                         </executions>
                     </plugin>
                     
diff --git a/pom.xml b/pom.xml
index ba4b605c..5073ec69 100644
--- a/pom.xml
+++ b/pom.xml
@@ -55,6 +55,8 @@
 
     <properties>
         <project.build.outputTimestamp>2023-01-05T15:25:16Z</project.build.outputTimestamp>
+        <!-- https://docs.sonarcloud.io/enriching/test-coverage/test-coverage-parameters/#javakotlinscalajvm -->
+        <sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/vault-coverage-aggregate/target/site/jacoco-aggregate/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
     </properties>
 
     <distributionManagement>
@@ -96,6 +98,13 @@
                         <verbose>false</verbose>
                     </configuration>
                 </plugin>
+                <plugin>
+                    <groupId>org.apache.rat</groupId>
+                    <artifactId>apache-rat-plugin</artifactId>
+                    <configuration>
+                        <excludesFile>${project.basedir}/.ratignore</excludesFile>
+                    </configuration>
+                </plugin>
            </plugins>
         </pluginManagement>
         <plugins>
@@ -386,5 +395,11 @@ file://${basedir}/target/vote.txt
                 </plugins>
             </build>
         </profile>
+        <profile>
+            <id>jacoco-report</id>
+            <modules>
+                <module>vault-coverage-aggregate</module>
+            </modules>
+        </profile>
     </profiles>
 </project>
diff --git a/vault-core-it/vault-core-it-execution/pom.xml b/vault-core-it/vault-core-it-execution/pom.xml
index df8260c8..ddc87663 100644
--- a/vault-core-it/vault-core-it-execution/pom.xml
+++ b/vault-core-it/vault-core-it-execution/pom.xml
@@ -104,7 +104,7 @@
                     <groupId>org.apache.rat</groupId>
                     <artifactId>apache-rat-plugin</artifactId>
                     <configuration>
-                        <excludes>
+                        <excludes combine.children="append">
                             <exclude>vault-core-it-execution-oak-min/**</exclude>
                         </excludes>
                     </configuration>
diff --git a/vault-core/pom.xml b/vault-core/pom.xml
index 1af03322..7652f4af 100644
--- a/vault-core/pom.xml
+++ b/vault-core/pom.xml
@@ -45,21 +45,6 @@
     <build>
         <pluginManagement>
             <plugins>
-                <plugin>
-                    <groupId>org.jacoco</groupId>
-                    <artifactId>jacoco-maven-plugin</artifactId>
-                    <executions>
-                        <execution>
-                            <id>report-merged</id>
-                            <configuration>
-                                <!-- https://github.com/jacoco/jacoco/issues/34 -->
-                                <includes>
-                                    <include>org/apache/jackrabbit/vault/**</include>
-                                </includes>
-                            </configuration>
-                        </execution>
-                    </executions>
-                </plugin>
                 <plugin>
                     <groupId>org.owasp</groupId>
                     <artifactId>dependency-check-maven</artifactId>
@@ -121,12 +106,6 @@
                             </archive>
                         </configuration>
                     </execution>
-                    <execution>
-                        <id>default-test-jar</id>
-                        <goals>
-                            <goal>test-jar</goal>
-                        </goals>
-                    </execution>
                 </executions>
             </plugin>
             <plugin>
diff --git a/vault-coverage-aggregate/pom.xml b/vault-coverage-aggregate/pom.xml
new file mode 100644
index 00000000..3865710e
--- /dev/null
+++ b/vault-coverage-aggregate/pom.xml
@@ -0,0 +1,122 @@
+<?xml version="1.0"?><!--
+    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 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+    child.project.url.inherit.append.path="false">
+    <modelVersion>4.0.0</modelVersion>
+    <!-- ====================================================================== -->
+    <!-- P A R E N T  P R O J E C T  D E S C R I P T I O N                      -->
+    <!-- ====================================================================== -->
+    <parent>
+        <groupId>org.apache.jackrabbit.vault</groupId>
+        <artifactId>parent</artifactId>
+        <relativePath>../parent/pom.xml</relativePath>
+        <version>3.6.9-SNAPSHOT</version>
+    </parent>
+    <artifactId>vault-coverage-aggregate</artifactId>
+    <packaging>pom</packaging>
+    <name>Apache Jackrabbit FileVault Aggregate Coverage Report </name>
+    <description>Jacoco Aggregate Coverage Report to be used with SonarCloud.io</description>
+    <dependencies>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>org.apache.jackrabbit.vault</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>vault-core-it-execution-jr2-min</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>vault-core-it-execution-oak-min</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>vault-core-it-execution-oak-max</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>vault-davex</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>vault-diff</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>org.apache.jackrabbit.vault.rcp</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>vault-sync</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>vault-validation</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>vault-vlt</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <!--
+            https://docs.sonarcloud.io/enriching/test-coverage/java-test-coverage/#add-coverage-in-a-multi-module-maven-project -->
+            <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>
+                        <configuration>
+                            <includes>
+                                <!-- shaded 3rd party classes -->
+                                <include>org/apache/jackrabbit/vault/**</include>
+                            </includes>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file
diff --git a/vault-hook-example/pom.xml b/vault-hook-example/pom.xml
index 88cf9863..f872b2fe 100644
--- a/vault-hook-example/pom.xml
+++ b/vault-hook-example/pom.xml
@@ -38,6 +38,10 @@
         Provides an example of a package install hook
     </description>
 
+    <properties>
+        <!-- skip from Sonarcloud analysis -->
+        <sonar.skip>true</sonar.skip>
+    </properties>
 
     <!-- ====================================================================== -->
     <!-- B U I L D   D E F I N I T I O N                                        -->
diff --git a/vault-hook-externalclass-test/pom.xml b/vault-hook-externalclass-test/pom.xml
index 6406f25f..613cc977 100644
--- a/vault-hook-externalclass-test/pom.xml
+++ b/vault-hook-externalclass-test/pom.xml
@@ -38,6 +38,10 @@
         Provides an example of a package install hook that uses a class not available in bundles classpath
     </description>
 
+    <properties>
+        <!-- skip from Sonarcloud analysis -->
+        <sonar.skip>true</sonar.skip>
+    </properties>
     <!-- ====================================================================== -->
     <!-- B U I L D   D E F I N I T I O N                                        -->
     <!-- ====================================================================== -->