Generate PDF file from jacoco and pit

1.1k Views Asked by At
  • My jacoco and pit coverage are in target/site.
  • I'm trying to convert them to pdf. I'm using maven-pdf plugin.
  • The maven-pdf plugin converted checkstyle and surefire into pdf, but not jacoco and pit.

Any suggestions?

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-pdf-plugin</artifactId>
    <executions>
        <execution>
            <id>pdf</id>
            <phase>site</phase>
            <goals>
                <goal>pdf</goal>
            </goals>
            <configuration>
                <outputDirectory>${project.reporting.outputDirectory}</outputDirectory>
                <includeReports>true</includeReports>
            </configuration>
        </execution>
    </executions>
    <dependencies>
        <!-- https://mvnrepository.com/artifact/xalan/xalan -->
        <dependency>
            <groupId>xalan</groupId>
            <artifactId>xalan</artifactId>
            <version>2.7.1</version>
        </dependency>

    </dependencies>
</plugin>
1

There are 1 best solutions below

3
On BEST ANSWER

Default output folder value for Jacoco is ${project.reporting.outputDirectory}/jacoco, default value for site folder in maven-pdf-plugin is ${basedir}/src/site.

So, you need to configure maven-pdf-plugin, to see, where Jacoco reports contain.

...
<configuration>
    <outputDirectory>${project.reporting.outputDirectory}</outputDirectory>
    <includeReports>true</includeReports>
    <siteDirectory>${project.reporting.outputDirectory}/jacoco</siteDirectory> <!-- specify your jacoco reports folder-->
</configuration>

...