Given a nested enumeration,
public class TestEnumHolder {
public enum TestEnum {
VALUE_1,
VALUE_2;
}
}
A source class (record for brievty),
public record TestEntity(String testProperty) {}
A target class,
public class TestDTO {
private TestEnumHolder.TestEnum testProperty;
public TestEnumHolder.TestEnum getTestProperty() {
return testProperty;
}
public void setTestProperty(TestEnumHolder.TestEnum testProperty) {
this.testProperty = testProperty;
}
}
A mapper,
@Mapper
public interface TestMapper {
TestDTO map(TestEntity entity);
}
When compiling the mapper with Mapstruct 1.5.2, the following error occurs:
TestMapperImpl.java:[23,66] package TestEnumHolder does not exist
When inspecting the generated mapper source, the import is missing for the enum.
This used to work with Mapstruct 1.4.1.
This is the reproduction case packaged as a Maven project:
mapstruct-nested-enum-repro.zip