Maven plugin fails in generating mutants for a class in the dependency

26 views
Skip to first unread message

Guglielmo De Angelis

unread,
May 15, 2024, 2:35:36 PM5/15/24
to PIT Users
Hi,
in the example at:
I am trying to use PIT (Maven Plugin) in order to mutate the class Fraction referred by means of a dependency declared in the project.

By running:
 * mvn -Pmutation clean verify org.pitest:pitest-maven:mutationCoverage
PIT fails by reporting:
 * [ERROR] Failed to execute goal org.pitest:pitest-maven:1.15.8:mutationCoverage (default-cli) on project pitExample: Execution default-cli of goal org.pitest:pitest-maven:1.15.8:mutationCoverage failed: No mutations found. This probably means there is an issue with either the supplied classpath or filters.

I am wondering if it is possible to mutate a binary class only referred in the classpath ... but as far I understood from the documentation:
it should be possible.
Do you have any suggestion on how to proceed?

Thanks
Gulyx

Henry Coles

unread,
May 15, 2024, 2:38:30 PM5/15/24
to pitu...@googlegroups.com
Pitest will only mutate code within the current project, it's not possible to mutate dependencies.

Henry

--
You received this message because you are subscribed to the Google Groups "PIT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pitusers+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pitusers/d19da2e0-1c32-46f4-a11c-b3c630754102n%40googlegroups.com.

Guglielmo De Angelis

unread,
May 17, 2024, 5:23:18 AM5/17/24
to PIT Users

Herny,
thanks for the prompt feedback.

I found a workaround in order to achieve the goal I described.
Specifically here:
 * https://github.com/gulyx/pitExample/blob/13c05970b78ddb9d6719196ea1b52edac0a46763/pom.xml#L85
I used the maven-dependency-plugin, so that to unpack a specific dependency within the (customizable) folder "target/classes".
This way PIT is able to mutate also the code of the specific dependencies that have been unpacked.

The example can run by launching:

 * mvn -Pmutation clean verify org.pitest:pitest-maven:mutationCoverage

Gulyx

Reply all
Reply to author
Forward
0 new messages