Issue
I followed this tutorial: https://pitest.org/quickstart/maven/
jar file won't open. I have Java Version 8 Update 291.
I tried:
$ java -jar pitest-maven-1.6.7.jar
no main manifest attribute, in pitest-maven-1.6.7.jar
I followed this tutorial: https://www.baeldung.com/java-mutation-testing-with-pitest
I step 5 doesn't work for mee: mvn command exist
mvn command is not recognized as an internal or external command 'mvn' is not recognized as an internal or external command,
mvn' is not recognized as an internal or external command
I don't have a path to Maven.
I also tried these tutorials, they are missing like key important steps:
https://medium.com/@mailshine/mutation-testing-can-unit-test-coverage-survive-a9f9b64e6fbf
https://dzone.com/articles/mutation-testing-covering-your-code-with-right-tes-1
these tutorials are too long and I'll probably be fast to get answer on stackoverflow:
https://www.youtube.com/watch?v=88fDcPurp-Y&ab_channel=SpringDeveloper
https://www.youtube.com/watch?v=DSv2vpvD-ds&ab_channel=GreenLearner
Solution
how to actually setup mutation testing in maven
basically... follow this tutorial: https://pitest.org/quickstart/maven/
skip the installation part in the tutorial
download apache-maven-3.8.1 [or whatever is the latest version]
add the downloaded file to your path via command line:
set PATH=%PATH%;C:\Program Files\apache-maven-3.8.1\bin
this is the actual plugin you wanna add:
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>1.6.7</version>
<dependencies>
<dependency>
<groupId>org.pitest</groupId>
<artifactId>pitest-junit5-plugin</artifactId>
<version>0.14</version>
</dependency>
</dependencies>
<configuration>
<targetClasses>
<param>com.my.project.*</param>
</targetClasses>
<targetTests>
<param>com.my.project*</param>
</targetTests>
</configuration>
</plugin>
you can replace the version & my.project but make sure my.project has .*
like this:
com.your.project.*
not this:
com.your.project
afterwards, you need this dependancy:
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
from here, the tutorial is pretty gud. you can continue by running this in command line:
mvn org.pitest:pitest-maven:mutationCoverage
then you open the folder etc. etc.
Answered By - solidwaterslayer