Help with Custom Mutator in PITest - "Mutator or group MY_CUSTOM_MUTATOR is unknown" Error

18 views
Skip to first unread message

Harsh Ruhela

unread,
May 5, 2025, 1:50:50 AMMay 5
to PIT Users

Hi everyone,

I'm working on a Java project where I'm trying to integrate a custom mutation operator using PITest (v1.17.0) with Maven. I’ve followed the available documentation and tried to register my custom mutator, but I’m running into the following error when I run the mutation coverage goal:

Error : 
Failed to execute goal org.pitest:pitest-maven:1.17.0:mutationCoverage (default-cli) on project custom-pit-mutator: Execution default-cli of goal org.pitest:pitest-maven:1.17.0:mutationCoverage failed: Mutator or group MY_CUSTOM_MUTATOR is unknown. Check PIT configuration and try again.

I've verified that the service provider entry is in place (META-INF/services/org.pitest.mutationtest.engine.MutatorFactory) and that the class is present in the build. Still, PIT does not recognize it.

Has anyone successfully integrated a custom mutator with PIT using Maven? Any pointers or sample configurations would be greatly appreciated.

Henry Coles

unread,
May 5, 2025, 3:50:41 AMMay 5
to pitu...@googlegroups.com
Is the mutator packaged up within its own jar as a plugin? Are you able to share the source?

Regards

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 visit https://groups.google.com/d/msgid/pitusers/64ac8559-0974-41c4-9388-ef421e1f9913n%40googlegroups.com.

Harsh Ruhela

unread,
May 5, 2025, 6:59:52 AMMay 5
to pitu...@googlegroups.com

Hii Henry , 
I have implemented the Method Mutator Factory and changed the opcode. I have registered the mutator in pom.xml.



Henry Coles

unread,
May 5, 2025, 7:01:56 AMMay 5
to pitu...@googlegroups.com
1. Is the mutator packaged up within its own jar as a plugin?
2. Are you able to share the source?

Reply all
Reply to author
Forward
0 new messages