Git Product home page Git Product logo

jacocoaggregated's Introduction

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>

jacocoaggregated's People

Contributors

spyhunter99 avatar

Watchers

Armel Soro avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.