第一个问题:Mapstruct 生成代码以定位具有标记“派生”的注释文件夹。RTC 忽略了这一点,因此我无法签入生成的代码(不要问我为什么要这样做 - 我需要它)。是否有机会禁用 gen-folder 上的派生标记,以便可以将生成的类 (.java) 检入存储库?第二个问题: Mapstruct 类应该在我的本地机器上生成,而不是在构建服务器上。如何配置 maven 仅在本地执行?
先感谢您。
目前我的 pom.xml 看起来像这样,因为我无法按照我需要的方式配置它:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<generatedSourcesDirectory>gen</generatedSourcesDirectory>
<annotationProcessorPaths>
<path>
<groupId>de.......</groupId>
<artifactId>mapstruct_config</artifactId>
<version>${config.version}</version>
</path>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${org.mapstruct.version}</version>
</path>
</annotationProcessorPaths>
<compilerArgs>
<compilerArg>
-Amapstruct.suppressGeneratorTimestamp=true
</compilerArg>
<compilerArg>
-Amapstruct.suppressGeneratorVersionInfoComment=true
</compilerArg>
<compilerArg>
-Amapstruct.unmappedTargetPolicy=WARN
</compilerArg>
</compilerArgs>
</configuration>
</plugin>
1:gen 文件夹没有派生标记 2:annotationProcessor 仅在本地机器上工作