13.3.2 Incremental Annotation Processing with Gradle and Kapt

To enable Gradle incremental annotation processing with Kapt, the arguments as specified in 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 your custom annotations, they will be ignored by Micronaut, which may break your application.