mer*_*hst 4 java eclipse maven mapstruct
我按照文档(http://mapstruct.org/documentation/stable/reference/html/)中的描述将 MapStruct 与 maven 一起使用。现在我想将生成的映射器类的位置从目标文件夹更改为源文件夹。我已经阅读了如何更改 mapstruct 生成的类位置和M2E 并让 maven 生成源文件夹作为 eclipse 源文件夹,并通过使用maven-processor-plugin(apt-maven-plugin也可能工作)使其工作。除此之外,我必须从maven-compiler-plugin 中删除annotationProcessorPaths。否则 maven 构建失败,因为生成的代码在“generate-sources ”(更改后的输出文件夹)和“ target\generated-sources\annotations ”(默认输出文件夹)。但是现在每次我在 Eclipse 中点击“ Maven ”-->“ Update Project ”我都必须重新-在项目属性中启用“启用注释处理”。当我手动更改 eclipse 中的“生成的源目录”时,它也将被覆盖。
那么是否可以在 maven 中更改输出目录并在 eclipse 中启用“启用注释处理”?我正在使用安装了 MapStruct 和 m2e-apt 插件的 Eclipse JEE 氧气。如果有帮助,我也使用 Spring Boot 1.5.9
你要找的是generatedSourcesDirectory
的选项maven-compiler
。该属性控制 Java Annotation Processor 将在何处输出生成的源。
我认为如果你设置了,Eclipse 和 Maven 之间的集成应该可以正常工作,你应该在不需要 build-helper-maven-plugin
归档时间: |
|
查看次数: |
3373 次 |
最近记录: |