Issue with annotation processor

Answered

Hi,

 

I'm having an issue to make immutables annotation processor working: I did follow theirs documentation but it does not appear to work as I do not see any generated code.

Here the configuration for the server-verifier module:

 

The model has immutable's dependency properly listed:

 

But when I build the module, there's no generated code:

 

When running through maven, I do not see any problem.

What can I do to troubleshoot this issue ?

 

1
7 comments

Have you enabled annotation processor for all the modules in project? When compiler is configured in Maven to build the project (is it error-prone compiler as well)?

When you build by Maven - does it generate the ImmutableResult class? Where will it be located in that case (you can navigate to it via Navigate | Class/File action)?

A sample project will be helpful to check the problem.

0

Yes when building with maven, classes are properly generated in the expected folder and yes, I've enabled annotation processing for all the modules that require it.

I have other projects with immutables and I do not have any error, only for this particular one so there should be a condition that break it.

The project is this one https://github.com/syndesisio/syndesis/tree/master/app

0

>Yes when building with maven, classes are properly generated in the expected folder

Where are they generated to (what is the folder path for ImmutableResult class)? Is it detected as a (generated)source root in IDE?

Doesn't look like I can build the main project. Any steps to set it up?

If you are using error-prone compiler when building by Maven make sure to install Error Prone Compiler plugin in IDE https://plugins.jetbrains.com/plugin/7349-error-prone-compiler-integration and check that it is set in IDE Java Compiler settings.

0

I have installed the error prone plugin and configured the compiler:

 

When building with maven, the code gets generated under the expected folders:

 

To build the project I would recommend to run:

 

    tools/bin/syndesis build --clean --flash --backend

 

From the root of the project

0

Thank you for details. Created the https://youtrack.jetbrains.com/issue/IDEA-214787 issue for the investigation.

0

Hi, It seems this is an old thread, but it looks like not resolved.

I have a similar issue with the annotation processor and Immutables. Required sources are generated properly, but IntelliJ still writes error under there usage.

Surprisingly, the reimport of maven dependencies makes IntelliJ realize generated sources.

 

IntelliJ IDEA 2019.2.3 (Ultimate Edition)
Build #IU-192.6817.14, built on September 24, 2019

1

Please sign in to leave a comment.