【发布时间】:2017-08-16 22:16:11
【问题描述】:
我正在使用注释处理来生成一些类...我有两个模块,处理器本身和使用它的“客户端”模块。我想通过客户端向处理器传递一个参数,我喜欢这样
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
<generatedSourcesDirectory>${project.build.directory}/generated-sources/</generatedSourcesDirectory>
<annotationProcessors>
<annotationProcessor>org.rapster.xxx.xxx.xxComponentProcessor</annotationProcessor>
</annotationProcessors>
<compilerArgs>
<arg>-Awidget=something</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
以及如何在处理器端检索此参数?
【问题讨论】:
标签: java maven annotations