簡體   English   中英

當我想從 KAPT 更改為 KSP 時,如何配置 spring-boot-configuration-processor? 我每次都會出錯

[英]How can I configuration spring-boot-configuration-processor when I would like to change from KAPT to KSP? I get every time error

基本問題, 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

我已經在 inte.net 上挖了快兩天了,但我仍然沒有找到解決這個問題的方法。 如果有人知道,我會很高興::)

KSP 不是 kapt 的直接替代品。 將一個名字更改為另一個名字不會成功。

spring-boot-configuration-processor不是為與 KSP 一起工作而構建的,所以這一行

ksp("org.springframework.boot:spring-boot-configuration-processor")

不會做任何事情。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM