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

pkarwasz pushed a commit to branch feature/coverage
in repository https://gitbox.apache.org/repos/asf/logging-parent.git

commit e5a808633ecefb01ac8178cc30682b3300253e02
Author: Piotr P. Karwasz <[email protected]>
AuthorDate: Tue Mar 19 09:38:55 2024 +0100

    Add test coverage profile
---
 pom.xml                                            | 120 +++++++++++++++------
 src/changelog/.10.x.x/140_add_coverage_profile.xml |   8 ++
 2 files changed, 93 insertions(+), 35 deletions(-)

diff --git a/pom.xml b/pom.xml
index bc89855..82f8f9d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -145,7 +145,7 @@
   <properties>
 
     <!-- project version -->
-    <revision>10.6.1-SNAPSHOT</revision>
+    <revision>10.7.0-SNAPSHOT</revision>
 
     <!-- `project.build.outputTimestamp` is required to be present for 
reproducible builds.
          We actually inherit one from the `org.apache:apache` parent.
@@ -299,6 +299,7 @@
     
<build-helper-maven-plugin.version>3.5.0</build-helper-maven-plugin.version>
     <cyclonedx-maven-plugin.version>2.7.11</cyclonedx-maven-plugin.version>
     <flatten-maven-plugin.version>1.6.0</flatten-maven-plugin.version>
+    <jacoco-maven-plugin.version>0.8.11</jacoco-maven-plugin.version>
     
<log4j-changelog-maven-plugin.version>0.7.0</log4j-changelog-maven-plugin.version>
     <maven-artifact-plugin.version>3.5.0</maven-artifact-plugin.version>
     
<restrict-imports-enforcer-rule.version>2.5.0</restrict-imports-enforcer-rule.version>
@@ -365,47 +366,46 @@
           <version>${asciidoctor-maven-plugin.version}</version>
         </plugin>
 
-        <!-- `artifact:compare` is used in 
`.github/workflows/build-reusable.yaml` -->
         <plugin>
-          <groupId>org.apache.maven.plugins</groupId>
-          <artifactId>maven-artifact-plugin</artifactId>
-          <version>${maven-artifact-plugin.version}</version>
+          <groupId>com.github.genthaler</groupId>
+          <artifactId>beanshell-maven-plugin</artifactId>
+          <version>${beanshell-maven-plugin.version}</version>
         </plugin>
 
         <plugin>
-          <groupId>org.codehaus.mojo</groupId>
-          <artifactId>flatten-maven-plugin</artifactId>
-          <version>${flatten-maven-plugin.version}</version>
+          <groupId>biz.aQute.bnd</groupId>
+          <artifactId>bnd-baseline-maven-plugin</artifactId>
+          <version>${bnd-baseline-maven-plugin.version}</version>
         </plugin>
 
         <plugin>
-          <groupId>org.simplify4u.plugins</groupId>
-          <artifactId>sign-maven-plugin</artifactId>
-          <version>${sign-maven-plugin.version}</version>
+          <groupId>biz.aQute.bnd</groupId>
+          <artifactId>bnd-maven-plugin</artifactId>
+          <version>${bnd-maven-plugin.version}</version>
         </plugin>
 
         <plugin>
-          <groupId>com.github.spotbugs</groupId>
-          <artifactId>spotbugs-maven-plugin</artifactId>
-          <version>${spotbugs-maven-plugin.version}</version>
+          <groupId>org.codehaus.mojo</groupId>
+          <artifactId>build-helper-maven-plugin</artifactId>
+          <version>${build-helper-maven-plugin.version}</version>
         </plugin>
 
         <plugin>
-          <groupId>org.codehaus.mojo</groupId>
-          <artifactId>xml-maven-plugin</artifactId>
-          <version>${xml-maven-plugin.version}</version>
+          <groupId>org.cyclonedx</groupId>
+          <artifactId>cyclonedx-maven-plugin</artifactId>
+          <version>${cyclonedx-maven-plugin.version}</version>
         </plugin>
 
         <plugin>
-          <groupId>com.diffplug.spotless</groupId>
-          <artifactId>spotless-maven-plugin</artifactId>
-          <version>${spotless-maven-plugin.version}</version>
+          <groupId>org.codehaus.mojo</groupId>
+          <artifactId>flatten-maven-plugin</artifactId>
+          <version>${flatten-maven-plugin.version}</version>
         </plugin>
 
         <plugin>
-          <groupId>com.github.genthaler</groupId>
-          <artifactId>beanshell-maven-plugin</artifactId>
-          <version>${beanshell-maven-plugin.version}</version>
+          <groupId>org.jacoco</groupId>
+          <artifactId>jacoco-maven-plugin</artifactId>
+          <version>${jacoco-maven-plugin.version}</version>
         </plugin>
 
         <plugin>
@@ -414,28 +414,35 @@
           <version>${log4j-changelog-maven-plugin.version}</version>
         </plugin>
 
+        <!-- `artifact:compare` is used in 
`.github/workflows/build-reusable.yaml` -->
         <plugin>
-          <groupId>biz.aQute.bnd</groupId>
-          <artifactId>bnd-baseline-maven-plugin</artifactId>
-          <version>${bnd-baseline-maven-plugin.version}</version>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-artifact-plugin</artifactId>
+          <version>${maven-artifact-plugin.version}</version>
         </plugin>
 
         <plugin>
-          <groupId>biz.aQute.bnd</groupId>
-          <artifactId>bnd-maven-plugin</artifactId>
-          <version>${bnd-maven-plugin.version}</version>
+          <groupId>org.simplify4u.plugins</groupId>
+          <artifactId>sign-maven-plugin</artifactId>
+          <version>${sign-maven-plugin.version}</version>
         </plugin>
 
         <plugin>
-          <groupId>org.codehaus.mojo</groupId>
-          <artifactId>build-helper-maven-plugin</artifactId>
-          <version>${build-helper-maven-plugin.version}</version>
+          <groupId>com.github.spotbugs</groupId>
+          <artifactId>spotbugs-maven-plugin</artifactId>
+          <version>${spotbugs-maven-plugin.version}</version>
         </plugin>
 
         <plugin>
-          <groupId>org.cyclonedx</groupId>
-          <artifactId>cyclonedx-maven-plugin</artifactId>
-          <version>${cyclonedx-maven-plugin.version}</version>
+          <groupId>com.diffplug.spotless</groupId>
+          <artifactId>spotless-maven-plugin</artifactId>
+          <version>${spotless-maven-plugin.version}</version>
+        </plugin>
+
+        <plugin>
+          <groupId>org.codehaus.mojo</groupId>
+          <artifactId>xml-maven-plugin</artifactId>
+          <version>${xml-maven-plugin.version}</version>
         </plugin>
 
       </plugins>
@@ -1659,6 +1666,49 @@ import org.apache.commons.codec.digest.*;
 
     </profile>
 
+    <!-- Generates coverage information -->
+    <profile>
+
+      <id>coverage</id>
+
+      <build>
+        <plugins>
+
+          <plugin>
+            <groupId>org.jacoco</groupId>
+            <artifactId>jacoco-maven-plugin</artifactId>
+            <configuration>
+              <includes>
+                <include>org/apache/flume/**</include>
+                <include>org/apache/log4j/**</include>
+                <include>org/apache/logging/**</include>
+              </includes>
+              <excludes>
+                <!-- Ignore test code -->
+                <exclude>**/test/**</exclude>
+              </excludes>
+            </configuration>
+            <executions>
+              <execution>
+                <id>prepare-jacoco-agent</id>
+                <goals>
+                  <goal>prepare-agent</goal>
+                </goals>
+              </execution>
+              <execution>
+                <id>report-test-coverage</id>
+                <goals>
+                  <goal>report</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+
+        </plugins>
+      </build>
+
+    </profile>
+
   </profiles>
 
 </project>
diff --git a/src/changelog/.10.x.x/140_add_coverage_profile.xml 
b/src/changelog/.10.x.x/140_add_coverage_profile.xml
new file mode 100644
index 0000000..f12813a
--- /dev/null
+++ b/src/changelog/.10.x.x/140_add_coverage_profile.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xmlns="http://logging.apache.org/log4j/changelog";
+       xsi:schemaLocation="http://logging.apache.org/log4j/changelog 
https://logging.apache.org/log4j/changelog-0.1.3.xsd";
+       type="added">
+  <issue id="140" link="https://github.com/apache/logging-parent/pull/140"/>
+  <description format="asciidoc">Add `coverage` profile to generate a test 
coverage report.</description>
+</entry>

Reply via email to