Maven Annotation Processing does not take module-info into account

Answered

Hi,

2019.2.x has terrible maven annotation support, however in 2019.2.4 we see that the annotations are no longer getting located at all for jdk 12 and up. The annotation configuration options however appear. This is regardless of the static list of annotations (that HAVE to be removed every project refresh) that gets added randomly breaking project builds and have no relation at all to the annotation lists read and performed by maven.

The change has to do with the fact that jdk 12 and up does not read META-INF/services for annotation processors *at all* - annotation processors are now mandatory to be defined using module-info :provides "javax....annotation with xxxxxx."

It looks like intellij only looks at METAINF/services/ to identify annotation processors, for the newer JDK's this is completely wrong.

Please urgently fix annotation processing in 2019.2.x as we are all on netbeans now while we wait for acceptable maven annotation processing support, or some have even opted to stay in 2019.1 but they are moving across quickly.

Thank you,

Marc

0
2 comments

Hi Marc,

>however in 2019.2.4 we see that the annotations are no longer getting located at all for jdk 12 and up. The annotation configuration options however appear. 

Could you please elaborate on this a bit. Do you mean annotation processor is not detected? How do you configure it in Maven? Does it work in command line Maven?

What do you have set in Settings (Preferences on macOS) | Build, Execution, Deployment | Compiler | Annotation Processors for corresponding modules? Does it help to enable Settings (Preferences on macOS) | Build, Execution, Deployment | Compiler | Annotation Processors | Use --processor-module-path compiler option (for Java 9 and later) (see this issue for details).

It would help greatly if you could provide a sample project and attach it with an issue in https://youtrack.jetbrains.com/issues/IDEA

0

Marc,

Can you please elaborate on your source for this:

> The change has to do with the fact that jdk 12 and up does not read META-INF/services for annotation processors *at all* - annotation processors are now mandatory to be defined using module-info :provides "javax....annotation with xxxxxx."
as https://docs.oracle.com/en/java/javase/12/tools/javac.html seems to say otherwise.

 

0

Please sign in to leave a comment.