Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify output format for jacoco plugin for maven?

I have a maven project with jacoco plugin, which generates reports in different formats, such as html, csv and xml. But I need only html. How can I specify it?

Here is some code, where I add jacoco plugin:

<build>
    <plugins>
        <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>${jacoco.plugin.version}</version>
            <executions>
                <execution>
                    <goals>
                        <goal>prepare-agent</goal>
                    </goals>
                </execution>
                <execution>
                    <id>report</id>
                    <phase>test</phase>
                    <goals>
                        <goal>report</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    //other plugins
    </plugins>
</build>

Then I run tests:

mnv clean test

And all reports appears in "target" directory.

I read documentation https://www.eclemma.org/jacoco/trunk/doc/maven.html, but I didn't found anything about how to pick requiring format. I found it only for Ant and Gradle.

I suppose I missing something, so I will be grateful for any clue.

like image 212
Viktoria Avatar asked Jan 27 '23 09:01

Viktoria


1 Answers

I searched the same thing and stumbled over the following issue with it: The old path was

target\jacoco\jacoco.report

The XML report however is put into:

target\site\jacoco

and in there are the XML, csv, html ...

like image 96
Lonzak Avatar answered Feb 04 '23 16:02

Lonzak