Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JaCoCo for Code Coverage Reports in Pass Support #142

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
94 changes: 94 additions & 0 deletions jacoco-aggregate-report/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>
<groupId>org.eclipse.pass</groupId>
<artifactId>pass-support</artifactId>
<version>1.14.0-SNAPSHOT</version>
</parent>

<artifactId>jacoco-aggregate-report</artifactId>

<properties>
</properties>

<dependencies>
<dependency>
<groupId>org.eclipse.pass</groupId>
<artifactId>pass-data-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.pass.deposit</groupId>
<artifactId>deposit-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.pass.deposit</groupId>
<artifactId>deposit-cri</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.pass.deposit</groupId>
<artifactId>deposit-model</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.pass.deposit</groupId>
<artifactId>deposit-util</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.pass</groupId>
<artifactId>pass-grant-loader</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.pass</groupId>
<artifactId>pass-journal-loader-nih</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.pass</groupId>
<artifactId>nihms-data-harvest</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.pass</groupId>
<artifactId>nihms-data-transform-load</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.pass</groupId>
<artifactId>nihms-etl-model</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.pass</groupId>
<artifactId>pass-notification-service</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove the version element here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the changes, check your commit.

<executions>
<execution>
<id>report-aggregate</id>
<phase>verify</phase>
<goals>
<goal>report-aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
15 changes: 15 additions & 0 deletions pass-data-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,21 @@
<groupId>org.cyclonedx</groupId>
<artifactId>cyclonedx-maven-plugin</artifactId>
</plugin>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd remove these line feeds in the children pom.xml file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the changes, check your commit.

<plugin>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this repeats in all modules, did you try defining this in a pluginManagement element in pass-support/pom.xml and then defining the plugin in the child modules (exception would be jacoco-aggregate-report which would remain as is)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I haven't, I can give this a try and see if it works!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool, this worked! Nice find!

<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>
</project>
14 changes: 14 additions & 0 deletions pass-deposit-services/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,20 @@
<version>3.4.0</version>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>
</project>
14 changes: 14 additions & 0 deletions pass-grant-loader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,20 @@
<artifactId>cyclonedx-maven-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>
</project>
15 changes: 15 additions & 0 deletions pass-journal-loader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,21 @@
<artifactId>maven-help-plugin</artifactId>
<version>3.4.0</version>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>

</build>
Expand Down
15 changes: 15 additions & 0 deletions pass-nihms-loader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,21 @@
<artifactId>maven-help-plugin</artifactId>
<version>3.4.0</version>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>

Expand Down
15 changes: 15 additions & 0 deletions pass-notification-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,21 @@
<groupId>org.cyclonedx</groupId>
<artifactId>cyclonedx-maven-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>
</project>
21 changes: 19 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@

<modules>
<module>pass-data-client</module>
<module>pass-journal-loader</module>
<module>pass-deposit-services</module>
<module>pass-grant-loader</module>
<module>pass-journal-loader</module>
<module>pass-nihms-loader</module>
<module>pass-notification-service</module>
<module>pass-deposit-services</module>
<module>jacoco-aggregate-report</module>
</modules>

<scm>
Expand All @@ -72,6 +73,7 @@

<properties>
<maven-dependency-plugin.version>3.8.1</maven-dependency-plugin.version>
<jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -107,6 +109,21 @@
<artifactId>maven-dependency-plugin</artifactId>
<version>${maven-dependency-plugin.version}</version>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>
</project>
Loading