java – 在maven中的注释处理器输出
发布时间:2020-12-14 17:47:35 所属栏目:Java 来源:网络整理
导读:我正在使用JSR 269作为编译时分析代码的方法,如果需要,则将其失败. 我在maven中显示我的注释处理器的输出时遇到麻烦(Ant确实显示输出) 我使用 javax.annotation.processing.Messager来显示警告和错误,但是在maven中我看不到它的输出. (我知道它运行,因为它生
我正在使用JSR 269作为编译时分析代码的方法,如果需要,则将其失败.
我在maven中显示我的注释处理器的输出时遇到麻烦(Ant确实显示输出) 我使用 javax.annotation.processing.Messager来显示警告和错误,但是在maven中我看不到它的输出. (我知道它运行,因为它生成代码,应该). 有任何想法吗? 解决方法
我认为你在编译器插件 –
MCOMPILER-66中遇到了一个Maven错误或更好的错误.当涉及注释处理时,编译器插件有几个问题,例如
MCOMPILER-62.真正的最佳选择是使用imo禁止编译器的注释处理插件,并使用
maven-processor-plugin.在这
blog post,你可以看到如何使用它.看起来像这样:
<plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> <compilerArgument>-proc:none</compilerArgument> </configuration> </plugin> <plugin> <groupId>org.bsc.maven</groupId> <artifactId>maven-processor-plugin</artifactId> <version>1.3.7</version> <executions> <execution> <id>process</id> <goals> <goal>process</goal> </goals> <phase>process-sources</phase> </execution> </executions> <dependencies> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-jpamodelgen</artifactId> <version>1.1.0.Final</version> <scope>compile</scope> </dependency> </dependencies> </plugin> 还要注意注释处理器依赖关系如何很好地仅限于插件. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |