Jacoco Aggregate Report Plugin Parent

Generates a combined Jacoco report

License

License

Categories

Categories

JaCoCo Application Testing & Monitoring Code Coverage
GroupId

GroupId

com.github.spyhunter99
ArtifactId

ArtifactId

jacoco-report-parent
Last Version

Last Version

1.0.3
Release Date

Release Date

Type

Type

pom
Description

Description

Jacoco Aggregate Report Plugin Parent
Generates a combined Jacoco report
Project URL

Project URL

https://github.com/spyhunter99/JacocoAggregated
Project Organization

Project Organization

Spyhunter99@github
Source Code Management

Source Code Management

https://github.com/spyhunter99/JacocoAggregated

Download jacoco-report-parent

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.spyhunter99/jacoco-report-parent/ -->
<dependency>
    <groupId>com.github.spyhunter99</groupId>
    <artifactId>jacoco-report-parent</artifactId>
    <version>1.0.3</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/com.github.spyhunter99/jacoco-report-parent/
implementation 'com.github.spyhunter99:jacoco-report-parent:1.0.3'
// https://jarcasting.com/artifacts/com.github.spyhunter99/jacoco-report-parent/
implementation ("com.github.spyhunter99:jacoco-report-parent:1.0.3")
'com.github.spyhunter99:jacoco-report-parent:pom:1.0.3'
<dependency org="com.github.spyhunter99" name="jacoco-report-parent" rev="1.0.3">
  <artifact name="jacoco-report-parent" type="pom" />
</dependency>
@Grapes(
@Grab(group='com.github.spyhunter99', module='jacoco-report-parent', version='1.0.3')
)
libraryDependencies += "com.github.spyhunter99" % "jacoco-report-parent" % "1.0.3"
[com.github.spyhunter99/jacoco-report-parent "1.0.3"]

Dependencies

compile (4)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 3.3.9
org.apache.maven.reporting : maven-reporting-api jar 3.0
org.apache.maven.reporting : maven-reporting-impl jar 2.4
org.codehaus.plexus : plexus-utils jar 3.0.24

Project Modules

  • jacoco-report-plugin
  • JacocoTestProject1
  • JacodoTestProject2

Jacoco Aggregated Maven Site Report

A simple plugin to aggregate all IT and UT Jacoco test results at the parent maven project

Usage

	<project>
	...
	<properties>
        ....
        <jacoco.it.execution.data.file>${project.build.directory}/coverage-reports/jacoco-it.exec</jacoco.it.execution.data.file>
        <jacoco.ut.execution.data.file>${project.build.directory}/coverage-reports/jacoco-ut.exec</jacoco.ut.execution.data.file>
		....
    </properties>
	
	<build>
		<plugins>
			....
			<plugin>
					<groupId>org.jacoco</groupId>
					<artifactId>jacoco-maven-plugin</artifactId>
					<version>0.7.9</version>
					<executions>
						<!--
							Prepares the property pointing to the JaCoCo runtime agent which
							is passed as VM argument when Maven the Surefire plugin is executed.
						-->
						<execution>
							<id>pre-unit-test</id>
							<goals>
								<goal>prepare-agent</goal>
							</goals>
							<configuration>
								<!-- Sets the path to the file which contains the execution data. -->
								<destFile>${jacoco.ut.execution.data.file}</destFile>
								<!--
									Sets the name of the property containing the settings
									for JaCoCo runtime agent.
								-->
								<propertyName>surefireArgLine</propertyName>
							</configuration>
						</execution>
						<!--
							Ensures that the code coverage report for unit tests is created after
							unit tests have been run.
						-->
						<execution>
							<id>post-unit-test</id>
							<phase>test</phase>
							<goals>
								<goal>report</goal>
							</goals>
							<configuration>
								<!-- Sets the path to the file which contains the execution data. -->
								<dataFile>${jacoco.ut.execution.data.file}</dataFile>
								<!-- Sets the output directory for the code coverage report. -->
								<outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
							</configuration>
						</execution>
						<!--
							Prepares the property pointing to the JaCoCo runtime agent which
							is passed as VM argument when Maven the Failsafe plugin is executed.
						-->
						<execution>
							<id>pre-integration-test</id>
							<phase>pre-integration-test</phase>
							<goals>
								<goal>prepare-agent</goal>
							</goals>
							<configuration>
								<!-- Sets the path to the file which contains the execution data. -->
								<destFile>${jacoco.it.execution.data.file}</destFile>
								<!--
									Sets the name of the property containing the settings
									for JaCoCo runtime agent.
								-->
								<propertyName>failsafeArgLine</propertyName>
							</configuration>
						</execution>
						<!--
							Ensures that the code coverage report for integration tests after
							integration tests have been run.
						-->
						<execution>
							<id>post-integration-test</id>
							<phase>post-integration-test</phase>
							<goals>
								<goal>report</goal>
							</goals>
							<configuration>
								<!-- Sets the path to the file which contains the execution data. -->
								<dataFile>${jacoco.it.execution.data.file}</dataFile>
								<!-- Sets the output directory for the code coverage report. -->
								<outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
							</configuration>
						</execution>
					 
					</executions>
				</plugin>
				
				<!-- Used for unit tests -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>2.15</version>
					<configuration>
						<!-- Sets the VM argument line used when unit tests are run. -->
						<argLine>${surefireArgLine}</argLine>
						<!-- Skips unit tests if the value of skip.unit.tests property is true -->
						<skipTests>${skip.unit.tests}</skipTests>
						<!-- Excludes integration tests when unit tests are run. -->
						
					</configuration>
				</plugin>
				....
           </plugins>
		   
		   
		   ....
		   
		   <reporting>
				<plugins>
					
					<plugin>
						<groupId>com.github.spyhunter99</groupId>
						<artifactId>jacoco-report-plugin</artifactId>
						<version>1.0.2</version>
						<reportSets>
							<reportSet>
								<reports>
									<report>jacoco-aggregate</report>
								</reports>
							</reportSet>
						</reportSets>
					</plugin>
					
				 
				</plugins>
			</reporting>
		   
		   .....
	</build>

Versions

Version
1.0.3
1.0.2