13.3.2 Incremental Annotation Processing with Gradle and Kapt

To enable gradle incremental annotation processing with Kapt the arguments as specified Incremental Annotation Processing with Gradle must be sent to Kapt

The following example demonstrates how to enable and configure incremental annotation processing for annotations you have defined under the com.example and io.example packages:

Enabling Incremental Annotation Processing in Kapt

  1. kapt {
  2. arguments {
  3. arg("micronaut.processing.incremental", true)
  4. arg("micronaut.processing.annotations", "com.example.*,io.example.*")
  5. }
  6. }
If you do not enable processing for custom annotations you define these annotations will simple be ignored by Micronaut which may break your application.