Micronaut-core: Kapt complains annotations are non-incremental with Kotlin 1.3.50

Created on 18 Aug 2019  路  6Comments  路  Source: micronaut-projects/micronaut-core

Task List

  • [X] Steps to reproduce provided
  • [ ] Stacktrace (if present) provided -- N/A
  • [X] Example that reproduces the problem uploaded to Github
  • [x] Full description of the issue provided (see below)

Steps to Reproduce

In building this project (link below), kapt complains vigorously that Micronaut annotations are non-incremental. I presume this issue is a "feature" request, rather than a bug. The code runs fine.

This only happens in Kotlin 1.3.50. With Kotlin 1.3.41, it does not happen.

(Note, there are other kapt warnings; I didn't want to mix concerns in the same GitHub issue.)

Expected Behaviour

No warnings from kapt about non-incremental annotations.

Actual Behaviour

This happens in every module of the project:

w: [kapt] Incremental annotation processing requested, but support is disabled because the following processors are not incremental: io.micronaut.annotation.processing.TypeElementVisitorProcessor (NON_INCREMENTAL), io.micronaut.annotation.processing.PackageConfigurationInjectProcessor (NON_INCREMENTAL), io.micronaut.annotation.processing.BeanDefinitionInjectProcessor (NON_INCREMENTAL).

Environment Information

  • Operating System: All I have tried (current Ubuntu, current Insider Windows 10, current MacOS)
  • Micronaut Version: 1.2.0 and 1.2.1.BUILD-SNAPSHOT
  • JDK Version: 11
  • Kotlin Version: 1.3.50

Example Application

Extra notes

I use this project as a showcase to encourage colleagues and client to consider Kotlin over Java, and Micronaut over Spring Boot.

I have an expected error to the console:

hm.binkley.basilisk.chef.PersistedChefsControllerTest > should get no chef() STANDARD_OUT
    07:31:07.667 [pool-3-thread-3] ERROR i.m.h.s.netty.RoutingInBoundHandler - Unexpected error occurred: No chef for CHEF123

I do not want this to distract, so mention it to avoid confusion when running the tests. I'm still working to understand @Error, and how Micronaut logs problems.

Most helpful comment

Probably self explanatory but I will add it here for future references:
If you are using kapt you pass the argument as so:
kapt { arguments { arg("micronaut.processing.incremental", true) } }

All 6 comments

Waiting for debugger never goes away. This is the only error I get.

I have an app on 1.2.0 where I was seeing this, I upgraded straight to 1.3.1 and I still get this warning.
Tried with 1.2.10 and the warning disappears. Has this fix been lost between 1.2.10 -> 1.3.x?

We had to disable it by default because it turns out that incremental annotation processors cannot handle all annotations so you have to configure the packages where you may have custom annotations defined. See https://docs.micronaut.io/latest/guide/index.html#java for information.

@graemerocher Thank you for the work and explanation on this. I still tout Kotlin+Micronaut to colleagues. :)

Probably self explanatory but I will add it here for future references:
If you are using kapt you pass the argument as so:
kapt { arguments { arg("micronaut.processing.incremental", true) } }

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adityasrini picture adityasrini  路  5Comments

dchenk picture dchenk  路  3Comments

gitjxm picture gitjxm  路  3Comments

denbilyk picture denbilyk  路  3Comments

radpet picture radpet  路  5Comments