Skip to content

Running an Analysis

Gerald Mücke edited this page Jul 30, 2018 · 1 revision

The plugin itself does not conduct the actual analysis but processes the reports produced by Pitest. Following the Quickstart to create a Pitest report, add the following plugin to your POM.

It's important to enable the XML report in the output formats section.

<plugin>
    <groupId>org.pitest</groupId>
    <artifactId>pitest-maven</artifactId>
    <version>LATEST</version>
    <configuration>
        <targetClasses>
            <param>com.your.package.root.want.to.mutate*</param>
        </targetClasses>
        <targetTests>
            <param>com.your.package.root*</param>
        </targetTests>
        <outputFormats>
            <param>XML</param><!-- this generates the reports parsed by the plugin -->
            <param>HTML</param>
        </outputFormats>
    </configuration>
</plugin>

And run Maven

mvn org.pitest:pitest-maven:mutationCoverage

Afterwards run the Sonar Analysis (assuming you have configured your Sonarqube server already)

mvn sonar:sonar
Clone this wiki locally