Intellij没有看到MapStruct生成的类

时间:2018-11-25 11:46:00

标签: java spring-boot spring-boot-test mapstruct

当我在MapStruct中使用spring-boot时,它会生成一个impl class,并且我希望可以访问该文件以在单元测试中导入,但是intellij没有看到它

@SpringBootTest(classes={OrderMapperImpl.class})

我出错了

Can't find a symbol OrderMapperImpl

1 个答案:

答案 0 :(得分:0)

通过右键单击目录target/generated-sources/annotations > Mark directory as... > Generated Sources Root,可以告诉IntelliJ将生成的mapstructs类作为源文件。

如果您配置了另一个输出路径,则需要选择该路径。