maven-processor-plugin忽略未定义的符号 [英] maven-processor-plugin to ignore undefined symbols
问题描述
我有JPA 2 maven项目,我想处理源以具有静态元模型.我做了什么 JBoss的静态元模型处理器并将其设置为在generate-sources
阶段运行.现在,显然我有一些引用元模型的类,编译本身就很好.但是maven-processor-plugin
本身会生成错误,抱怨它无法从这样的元模型中找到符号:
I've JPA 2 maven project and I want to process sources to have the static meta model. What I did I took JBoss' static meta model processor and set it up to run during generate-sources
phase. Now, obviously I have some classes that reference the meta model and compilation itself goes fine. But maven-processor-plugin
itself generates errors complaining that it can't find symbols from meta model like this:
[INFO] --- maven-processor-plugin:2.2.4:process (process) @ ng-grid-java ---
[ERROR] diagnostic: c:\...\service\position\PositionSpecifications.java:13: cannot find symbol
symbol : class Position_
这是合乎逻辑的,因为它实际上生成了这些类,但是不正确,因为它给本来正确的项目带来了错误.还是我使用错了?我想念什么吗?
Which is logical because it actually generates these classes, but is not right since it brings errors to an otherwise correct project. Or maybe I'm using it wrong? Am I missing something?
更新:我已经能够通过使用配置参数outputDiagnostics
来抑制错误输出,但是我不确定这是正确的方法.
Update: I have been able to inhibit the error output by using configuration parameter outputDiagnostics
but I'm not sure that's the right way.
推荐答案
我已经设置了插件的阶段 -s,例如:
I have setted the phase-s of the plugins like:
build-helper-maven-plugin --> <phase>process-sources</phase>
和
maven-processor-plugin --> <phase>compile</phase>
这篇关于maven-processor-plugin忽略未定义的符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!