26
votes

How can I configure IntelliJ IDEA to have Annotation processors enabled by default?

Currently, I have to enable it manually for every imported project.

enable annotation processor

1
Do you import the project from Maven or Gradle? - CrazyCoder
@CrazyCoder mostly - gradle. I just want this flag to be checked by default. There should not be any issues if there are no annotation processors on classpath. - Andrii Abramov
Did you try File | Other Settings | Default Settings and enable it there before importing? - CrazyCoder
@CrazyCoder thank you. I did not know about File | Other Settings | Default Settings. This seems to be an answer to mu question. - Andrii Abramov
IntelliJ has started asking this every time I open the IDE in 2020.2. - maaw

1 Answers

42
votes

Current IDE version:

File | New Project Settings | Settings for New Projects..., navigate to the compiler settings, annotation processing and enable this option before importing the project.

Previous versions:

File | Other Settings | Default Settings, navigate to the compiler settings, annotation processing and enable this option before importing the project.