Configuring the pit-idea plugin

The plugin should work out of the box when using JUnit versions 5.7.2 through 5.13.0. This is because the necessary jars for those JUnit versions are bundled with the plugin, so no additional configuration is required.

You may have to add additional dependencies to your build file if: The classpath logic used by the plugin is completely configurable. You can add your own dependencies in place of the files that PIT would use from its bundled directory. If your classpath already has any version of some jar X, then the plugin will not include any other version of X. Also, if you have any version of PITest in your classpath, the plugin will not attempt to include any related PITtest jars since these tend to work in particular combinations, and the plugin can't anticipate all cases. You can always see the full classpath used in the last PIT execution by clicking the "Show Classpath..." button in the upper right of the toolwindow console pane. The classpath elements the plugin added are highlighted in green.

For reference, below are examples of including older or newer versions of PITest (the newer version shown only works for the latest JUnit). Note that the plugin requires pitest-command-line in addition to the main pitest jar. Including the former transitively includes the latter. Also note that it is fine to load them in test scope as far as the pit-idea plugin is concerned. If you add dependencies like these to your build file, you will see fewer if any green highlighted rows in the "Show Classpath..." popup because (based on the rules described above) the plugin will not have added anything additional.


        <dependency>
            <groupId>org.pitest</groupId>
            <artifactId>pitest-command-line</artifactId>
            <version>1.15.8</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.pitest</groupId>
            <artifactId>pitest-junit5-plugin</artifactId>
            <version>1.2.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.pitest</groupId>
            <artifactId>pitest-command-line</artifactId>
            <version>1.19.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.pitest</groupId>
            <artifactId>pitest-junit5-plugin</artifactId>
            <version>1.2.2</version>
            <scope>test</scope>
        </dependency>

    testImplementation("org.pitest:pitest-command-line:1.15.8")
    testImplementation("org.pitest:pitest-junit5-plugin:1.2.1")

    testImplementation("org.pitest:pitest-command-line:1.19.4")
    testImplementation("org.pitest:pitest-junit5-plugin:1.2.2")