基本问题是,kapt
处于维护模式。所以我想换到ksp
。理论上,它相当于更快的速度,就像kapt。变化的选项还不清楚。
我做了:
这是
plugin {
...
kotlin("kapt") version "1.7.20"
...
代之
plugin {
...
id("com.google.devtools.ksp") version "1.7.20-1.0.7"
...
}
而且有
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
kapt("org.springframework.boot:spring-boot-configuration-processor")
代之
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
ksp("org.springframework.boot:spring-boot-configuration-processor")
因此,当我构建项目时,我得到了以下错误:
> Task :kspKotlin FAILED
e: [ksp] No providers found in processor classpath.
e: Error occurred in KSP, check log for detail
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':kspKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================
* Get more help at https://help.gradle.org
BUILD FAILED in 829ms
1 actionable task: 1 executed
我已经在互联网上挖掘了近两天,但我仍然没有找到解决这个问题的方法。如果有人知道,我会很高兴的!:)
发布于 2022-11-30 22:43:05
KSP不是kapt的直接替代品。把一个名字改成另一个名字是行不通的。
spring-boot-configuration-processor
不是为使用KSP而构建的,所以这一行
ksp("org.springframework.boot:spring-boot-configuration-processor")
什么也做不了。
https://stackoverflow.com/questions/74422163
复制相似问题