-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KAPT Fails with Spring Modulith 1.3.0 in Kotlin Project #982
Comments
That seems to be an incomplete analysis. Both on Modulith 1.3 and 1.2.4, the > Task :kaptTestKotlin FAILED
Transforming main with StructureTransformAction
Transforming main with StructureTransformAction
Transforming main with StructureTransformAction
Transforming kotlin-reflect-1.9.25.jar with StructureTransformAction
Transforming kotlin-test-junit5-1.9.25.jar with StructureTransformAction
Transforming kotlin-test-1.9.25.jar with StructureTransformAction
Transforming kotlin-stdlib-1.9.25.jar with StructureTransformAction
Transforming spring-modulith-starter-core-1.2.4.jar with StructureTransformAction
Transforming mapstruct-1.6.3.jar with StructureTransformAction
Transforming spring-modulith-starter-test-1.2.4.jar with StructureTransformAction
Transforming spring-boot-starter-test-3.4.0.jar with StructureTransformAction
Transforming annotations-13.0.jar with StructureTransformAction
Transforming spring-modulith-test-1.2.4.jar with StructureTransformAction
Transforming spring-modulith-docs-1.2.4.jar with StructureTransformAction
Transforming spring-modulith-core-1.2.4.jar with StructureTransformAction
Transforming spring-modulith-api-1.2.4.jar with StructureTransformAction
Transforming spring-modulith-moments-1.2.4.jar with StructureTransformAction
Transforming spring-boot-starter-3.4.0.jar with StructureTransformAction
Transforming spring-boot-test-autoconfigure-3.4.0.jar with StructureTransformAction
Transforming spring-boot-test-3.4.0.jar with StructureTransformAction
Transforming json-path-2.9.0.jar with StructureTransformAction
Transforming jakarta.xml.bind-api-4.0.2.jar with StructureTransformAction
Transforming json-smart-2.5.1.jar with StructureTransformAction
Transforming assertj-core-3.26.3.jar with StructureTransformAction
Transforming awaitility-4.2.2.jar with StructureTransformAction
Transforming hamcrest-2.2.jar with StructureTransformAction
Transforming junit-jupiter-params-5.11.3.jar with StructureTransformAction
Transforming junit-jupiter-api-5.11.3.jar with StructureTransformAction
Transforming junit-platform-commons-1.11.3.jar with StructureTransformAction
Transforming junit-jupiter-5.11.3.jar with StructureTransformAction
Transforming mockito-junit-jupiter-5.14.2.jar with StructureTransformAction
Transforming mockito-core-5.14.2.jar with StructureTransformAction
Transforming jsonassert-1.5.3.jar with StructureTransformAction
Transforming spring-test-6.2.0.jar with StructureTransformAction
Transforming spring-boot-autoconfigure-3.4.0.jar with StructureTransformAction
Transforming spring-boot-3.4.0.jar with StructureTransformAction
Transforming spring-tx-6.2.0.jar with StructureTransformAction
Transforming spring-context-6.2.0.jar with StructureTransformAction
Transforming spring-aop-6.2.0.jar with StructureTransformAction
Transforming spring-beans-6.2.0.jar with StructureTransformAction
Transforming spring-expression-6.2.0.jar with StructureTransformAction
Transforming spring-core-6.2.0.jar with StructureTransformAction
Transforming xmlunit-core-2.10.0.jar with StructureTransformAction
Transforming jmolecules-events-1.9.0.jar with StructureTransformAction
Transforming spring-boot-starter-logging-3.4.0.jar with StructureTransformAction
Transforming jakarta.annotation-api-2.1.1.jar with StructureTransformAction
Transforming snakeyaml-2.3.jar with StructureTransformAction
Transforming jakarta.activation-api-2.1.3.jar with StructureTransformAction
Transforming accessors-smart-2.5.1.jar with StructureTransformAction
Transforming byte-buddy-1.15.10.jar with StructureTransformAction
Transforming byte-buddy-agent-1.15.10.jar with StructureTransformAction
Transforming android-json-0.0.20131108.vaadin1.jar with StructureTransformAction
Transforming spring-jcl-6.2.0.jar with StructureTransformAction
Transforming opentest4j-1.3.0.jar with StructureTransformAction
Transforming apiguardian-api-1.1.2.jar with StructureTransformAction
Transforming structurizr-export-1.19.0.jar with StructureTransformAction
Transforming structurizr-core-1.29.0.jar with StructureTransformAction
Transforming logback-classic-1.5.12.jar with StructureTransformAction
Transforming log4j-to-slf4j-2.24.1.jar with StructureTransformAction
Transforming jul-to-slf4j-2.0.16.jar with StructureTransformAction
Transforming asm-9.6.jar with StructureTransformAction
Transforming archunit-1.3.0.jar with StructureTransformAction
Transforming jackson-annotations-2.18.1.jar with StructureTransformAction
Transforming jsr305-3.0.2.jar with StructureTransformAction
Transforming commons-logging-1.2.jar with StructureTransformAction
Transforming micrometer-observation-1.14.1.jar with StructureTransformAction
Transforming logback-core-1.5.12.jar with StructureTransformAction
Transforming slf4j-api-2.0.16.jar with StructureTransformAction
Transforming log4j-api-2.24.1.jar with StructureTransformAction
Transforming micrometer-commons-1.14.1.jar with StructureTransformAction
file or directory '/Users/odrotbohm/temp/demo/src/test/java', not found
file or directory '/Users/odrotbohm/temp/demo/src/test/java', not found
Caching disabled for task ':kaptTestKotlin' because:
Build cache is disabled
Task ':kaptTestKotlin' is not up-to-date because:
Task has failed previously.
The input changes require a full rebuild for incremental task ':kaptTestKotlin'.
Running kapt annotation processing using the Gradle Worker API
Using workers NONE isolation mode to run kapt
/Users/odrotbohm/temp/demo/build/tmp/kapt3/stubs/test/com/example/demo/TestcontainersConfiguration.java:12: error: incompatible types: NonExistentClass cannot be converted to Annotation
@error.NonExistentClass()
^
/Users/odrotbohm/temp/demo/build/tmp/kapt3/stubs/test/com/example/demo/TestcontainersConfiguration.java:19: error: incompatible types: NonExistentClass cannot be converted to Annotation
@error.NonExistentClass()
^ |
Me too,
|
@odrotbohm sorry, That said my stacktrace also refers to same problem as @chenzhenjia :
|
I took a better look at console output and spotted the following:
Adding the following in build.gradle.kts resolves the error:
But it seems that in that case SpringModulithProcessor is not discovered and is not used. |
With:
Including into
Results in the same error as before. |
Use the following configuration to run normally
|
@chenzhenjia explicitly adding under dependencies |
With this project demo_spring_modulith_kotlin_kapt_correct.zip I tried as you suggested:
But still have the some error. Are you sure those |
remove kapt("org.springframework.modulith:spring-modulith-apt") |
Issue Description:
Upgrading
spring-modulith
from1.2.4
to1.3.0
causes the KAPT task to fail in a Kotlin project using MapStruct. Error message:The issue occurs with Spring Boot
3.3.6
and3.4.0
. Downgrading to spring-modulith to1.2.4
resolves the problem.Steps to Reproduce:
./gradlew build
) with Spring Modulith1.3.0
.Expected Behavior:
The build should complete successfully.
Actual Behavior:
The build fails with the error during the KAPT task.
Seeing as this was not a problem in 1.2.4, I don't think its a MapStruct or KAPT issue (though KAPT is quirky).
Demo project is attached for reference.
demo_spring_modulith_kotlin_kapt.zip
The text was updated successfully, but these errors were encountered: