ProcessorTests are currently unable to reload Mapper implementation class
Author: hduelmeCreated Sep 19, 2026Updated Sep 19, 2026
Labelsbugtest
Expected behavior
When a Mapper implementation is loaded in a test like
@ProcessorTest
void someTest() {
MyMapper mapper = Mappers.getMapper( MyMapper.class );
}the loaded Mapper should be the one generated by the test. For example the one generated by Eclipse or JDK compiler.
Actual behavior
Currently a Mapper implementation is only loaded once from whatever test run loads it first. This a limitation of the used class loading.
Steps to reproduce the problem
@ProcessorTest
void someTest() {
MyMapper mapper = Mappers.getMapper( MyMapper.class );
System.out.println( mapper.getClass().getProtectionDomain().getCodeSource().getLocation() );
}You will see that the source code location does not change
MapStruct Version
All versions
Source: mapstruct/mapstruct