Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable Annotation processors by default

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

like image 876
Andrii Abramov Avatar asked Jun 09 '17 08:06

Andrii Abramov


People also ask

How do I enable annotation processing in Intellij?

Press Ctrl+Alt+S to open the IDE settings and select Build, Execution, Deployment | Compiler | Annotation Processors.

What is an annotation processor?

Annotation processing is a tool built into javac for scanning and processing annotations at compile time. It can create new source files; however, it can't modify existing ones. It's done in rounds. The first round starts when the compilation reaches the pre-compile phase.

Why annotate is disabled in Intellij?

The module with the disabled "Annotate" option was in the "Unregistered Roots" section. To fix the problem, I selected the module and pressed the "+" icon in the lower toolbar to register the module root with Intellij VCS. The change is immediate and the "Annotate" options becomes available.


1 Answers

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.

like image 83
CrazyCoder Avatar answered Oct 17 '22 23:10

CrazyCoder