Configure KAPT plugin when an annotation processor is selected
See original GitHub issueThe initializr should generate the appropriate entries for KAPT if the language is Kotlin and the ConfigurationProcessor is selected as dependency.
In gradle you just need to add the processor as an dependency to the kapt
configuration:
dependencies { kapt "org.springframework.boot:spring-boot-configuration-processor" }
https://stackoverflow.com/questions/37858833/spring-configuration-metadata-json-file-is-not-generated-in-intellij-idea-for-ko
Maven is a bit more verbose https://kotlinlang.org/docs/reference/kapt.html and requires declaration of the kapt
goal. However, there is an open issue that prevents kapt from working if a compiler plugin (e.g. kotlin-maven-allopen) is added as dependency https://youtrack.jetbrains.com/issue/KT-18022
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:13 (8 by maintainers)
Top Results From Across the Web
Using kapt | Kotlin
By default, kapt runs all annotation processors and disables annotation processing by javac. However, you may need some of javac's annotation ...
Read more >Configure annotation processors | IntelliJ IDEA Documentation
Press Ctrl+Alt+S to open the IDE settings and select Build, Execution, Deployment | Compiler | Annotation Processors.
Read more >Android project with Java and Kotlin files, kapt or ...
First of all, the Kotlin Annotation processing tool (kapt) uses the Java compiler to run annotation processors. If your project contains any ...
Read more >Android/Kotlin Series: [#03] Kotlin plugin should be enabled ...
Kotlin plugin doesn't pick up annotationProcessor dependencies, So we have to use kapt dependencies with kotlin-kapt . Use the latest version of Kotlin ......
Read more >The Guide To Your First Annotation Processor with KSP (And ...
In this article, we are going to create ListGen, a KSP-based library that creates a list out of all the functions that have...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Was anyone able to successfully use
kapt
to generate spring boot configuration metadata? I’ve created the simplest possible project with Gradle, but when I run build nothing happens. https://github.com/dima767/bootiful-kt-with-config-metadata-processing If someone could point me to a right direction that would be appreciated!I am not sure if the issue in kotlin is still present… I was able to make it working using following configuration:
Perhaps this info from kapt docs is also relevant: