[英]Compilation error for annotations in Java 1.8 and IntelliJ IDEA 14
I was playing with Java annotation processing. 我正在玩Java注释处理。 Application build fails in IntelliJ IDEA, while a maven build ends successfully. IntelliJ IDEA中的应用程序构建失败,而maven构建成功结束。 I am sure that provider class exists, yet I get the following error: 我确信提供程序类存在,但我收到以下错误:
java: Bad service configuration file, or exception thrown while constructing Processor object: javax.annotation.processing.Processor: Provider <my class> not found.
I suppose that's because of a module X
, that should be compiled with -proc:none
argument. 我想这是因为模块X
应该用-proc:none
参数编译。 But I need annotation processing to be enabled for the rest of application. 但我需要为其余的应用程序启用注释处理。 How to configure IntelliJ IDEA build proccess to skip a specific module during annotation proccessing? 如何配置IntelliJ IDEA构建过程以在注释过程中跳过特定模块?
You need to configure a separate annotation profile for your module. 您需要为模块配置单独的注释配置文件。
default
profile. 在default
配置文件下的模块列表中选择您的模块。 (By default, all the modules of a project are associated with the default
profile.) (默认情况下,项目的所有模块都与default
配置文件相关联。) default
profile. 启用 default
配置文件的注释处理。 This answer is based on an article from IntelliJ IDEA Help . 这个答案基于IntelliJ IDEA帮助中的一篇文章。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.