-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Labels
lang: kotlinIssues or features specific to KotlinIssues or features specific to Kotlin
Description
Expected Behavior
If both ksp and kapt plugins are available, only one should be used.
Actual Behaviour
If both ksp and kapt plugins are available, both also create bean definitions, which is inefficient. It also leads to and exception when building the jar:
Execution failed for task ':runnerJar'.
Entry org/example/$ExampleController$Definition$Reference.class is a duplicate but no duplicate handling strategy has been set. Please refer to https://docs.gradle.org/8.2/dsl/org.gradle.api.tasks.Copy.html#org.gradle.api.tasks.Copy:duplicatesStrategy for details.
However this can be resolved by specifying a duplicate strategy, but it is still inefficient. Sometimes kapt is also needed for other annotation processors.
Steps To Reproduce
- Create application with micronaut launch:
mn create-app --build=gradle_kotlin --jdk=17 --lang=kotlin --test=junit com.example.demo - Create any Bean or Controller
- Add kapt plugin to build.gradle.kts
- Run the assemble task
Environment Information
- Operating System: macos 13.4.1 arm
- JDK 17.0.6
Example Application
https://github.com/braeluca/micronaut-kapt-ksp-demo
Version
4.0.3
forresthopkinsa
Metadata
Metadata
Assignees
Labels
lang: kotlinIssues or features specific to KotlinIssues or features specific to Kotlin