首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >当我想从KAPT转换为KSP时,我如何配置弹簧引导配置处理器?我每次都会犯错误

当我想从KAPT转换为KSP时,我如何配置弹簧引导配置处理器?我每次都会犯错误
EN

Stack Overflow用户
提问于 2022-11-13 15:10:36
回答 1查看 47关注 0票数 1

基本问题是,kapt处于维护模式。所以我想换到ksp。理论上,它相当于更快的速度,就像kapt。变化的选项还不清楚。

我做了:

这是

代码语言:javascript
复制
plugin {
   ...
   kotlin("kapt") version "1.7.20"
   ...

代之

代码语言:javascript
复制
plugin {
   ...
   id("com.google.devtools.ksp") version "1.7.20-1.0.7"
   ...
}

而且有

代码语言:javascript
复制
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
kapt("org.springframework.boot:spring-boot-configuration-processor")

代之

代码语言:javascript
复制
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
ksp("org.springframework.boot:spring-boot-configuration-processor")

因此,当我构建项目时,我得到了以下错误:

代码语言:javascript
复制
> 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

我已经在互联网上挖掘了近两天,但我仍然没有找到解决这个问题的方法。如果有人知道,我会很高兴的!:)

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-11-30 22:43:05

KSP不是kapt的直接替代品。把一个名字改成另一个名字是行不通的。

spring-boot-configuration-processor不是为使用KSP而构建的,所以这一行

代码语言:javascript
复制
ksp("org.springframework.boot:spring-boot-configuration-processor")

什么也做不了。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74422163

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档