IntelliJ IDEA 11.1 Web Help

File | Settings | Compiler | Annotation Processors

Ctrl+Alt+SCommand Comma

IntelliJ IDEA | Preferences | Compiler | Annotation Processors

Ctrl+Alt+SCommand Comma

Use this page to configure annotation processing for your sources.

Enable annotation processing options

If you want annotation processors to be run during the compilation, select the Enable annotation processing check box and specify the associated options.

Item Description
Obtain processors from project classpath Select this option, if you want IntelliJ IDEA to obtain the annotation processors from the project classpath. This is useful, for example, if you use a custom annotation processor as part of your project, or if the processor is stored in a .jar file attached to all the corresponding modules as a library.
Processor path If the annotation processor class is stored in a separate .jar file, or it is not desirable to add the processor libraries to the project classpath, you can select this option and specify the path to the corresponding processor.

Annotation Processors section

Specify the annotation processors to be run.

Item Description
add (Alt+InsertControl N ) Use this icon or shortcut to add an annotation processor to the list.
delete (Alt+DeleteCommand Delete) Use this icon or shortcut to remove the selected annotation processor from the list.
Processor FQ Name Specify the processor fully qualified name.
Processor Run Options If necessary, specify the processor run options either as -key=value, or key=value.

Use spaces to separate individual options.

Processed Modules section

Specify the modules to be processed by the annotation processors.

Note

  • Do not include the modules in which the corresponding annotation processors are defined and also the ones that form "cycles".
  • The annotation processors will skip the sources listed on the Compiler | Excludes page.
Item Description
add (Alt+InsertControl N ) Use this icon or shortcut to add a module to the list.
delete (Alt+DeleteCommand Delete) Use this icon or shortcut to remove the selected module from the list.
Module In this field, the module name and path are shown.
Generated Source Directory Name By default, the sources generated by annotation processors are stored in the project output directory. Using this field, you can override this behaviour for certain modules.

Specify the name of the directory in which you want IntelliJ IDEA to store the generated sources. The corresponding directories will be created within the content roots of the corresponding modules.

Note

At a later time, if you want to use the generated classes as your own sources, you can mark the corresponding directories as source roots.

Warning

On rebuild, the directories in which the generated sources are stored will be cleaned up as ordinary output directories. So it is not recommended to store non-generated sources in such directories. Otherwise, the corresponding sources will be lost on rebuild.

See Also

Concepts:

Web Resources: