igorpeclat / jacoco

Fork of SourceForge JaCoCo with new support in jacoco-maven-plugin for maven-site-plugin maven-site-plugin 3.0

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EclEmma JaCoCo Module with Maven-Site-Plugin 3.0 Support

This is a maven-site-plugin 3.0-supporting fork of the JaCoCo module in the EclEmma project. This fork will be of interest to people who would like to use Maven 3's "site" target and see JaCoCo coverage reports generated in the target/site directory.

You do not need to clone this GitHub repository to use the fork. You can use it immediately by making two simple changes to your project's pom.xml.

First, declare this project as a plugin repository:

<pluginRepositories>
  <pluginRepository>
    <id>jacoco-fork</id>
    <name>Maven2 JaCoCo Plugin Repository</name>
    <url>https://raw.github.com/benalexau/jacoco/master/releases/</url>
  </pluginRepository>
</pluginRepositories>

Second, enable the plugin:

<project>
    <build>
        <plugins>
            <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.5.6.20111223072633</version>
            <executions>
                <execution>
                    <id>amend-unit-test-java-agent-option</id>
                    <goals>
                        <goal>prepare-agent</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-site-plugin</artifactId>
            <version>3.0-beta-3</version>
            <configuration>
                <reportPlugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                    </plugin>
                </reportPlugins>
            </configuration>
            </plugin>
        </plugins>
    </build>
</project>

To use the plugin for a quick report:

mvn clean test jacoco:report

To use the plugin as part of Maven site builds:

mvn clean test site

Ticket 3461365 has been logged against the original project so they can easily test this fork with various Maven projects and ideally incorporate these changes. As such, please check the ticket for updates before using this fork.

About

Fork of SourceForge JaCoCo with new support in jacoco-maven-plugin for maven-site-plugin maven-site-plugin 3.0