简体   繁体   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

Basic problem, kapt is in maintenance mode.基本问题, kapt处于维护模式。 So I would like to change to ksp .所以我想换成ksp In theory, it's the equivalent of faster like kapt.从理论上讲,它相当于像 kapt 一样更快。 The changing option is not clear.更改选项不清楚。

I did:我做了:

This was这是

plugin {
   ...
   kotlin("kapt") version "1.7.20"
   ...

replaced by取而代之

plugin {
   ...
   id("com.google.devtools.ksp") version "1.7.20-1.0.7"
   ...
}

and there were还有

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

replaced by取而代之

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

So, when I build project I got below error:因此,当我构建项目时出现以下错误:

> 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

I've been mining the inte.net for almost two days, but I still haven't found a solution to this problem.我已经在 inte.net 上挖了快两天了,但我仍然没有找到解决这个问题的方法。 If anyone knows, I will be very happy: :)如果有人知道,我会很高兴::)

KSP is not a direct replacement to kapt. KSP 不是 kapt 的直接替代品。 Changing one name to another won't do the trick.将一个名字更改为另一个名字不会成功。

spring-boot-configuration-processor wasn't built to work with KSP, so this line spring-boot-configuration-processor不是为与 KSP 一起工作而构建的,所以这一行

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

won't do anything.不会做任何事情。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 "在 gradle 多项目中使用 kapt 和 spring-boot-configuration-processor" - Use kapt with spring-boot-configuration-processor in a gradle multi project spring-boot-configuration-processor是否处理带注释的bean方法? - Does spring-boot-configuration-processor process annotated bean methods? 什么是spring-boot-configuration-processor? 人们为什么要从中排除图书馆? 为什么它在依赖树中不可见? - What is the spring-boot-configuration-processor ? Why do people exclude libraries from it? Why is it invisible in dependency tree? Maven 需要为托管依赖项 spring-boot-configuration-processor 指定插件版本 - Maven requires plugin version to be specified for the managed dependency spring-boot-configuration-processor 如何从Spring获取Hibernate Configuration对象? - How can I get the Hibernate Configuration object from Spring? 如何禁用Spring Boot日志记录配置? - How can I disable Spring Boot logging configuration? 如何使用spring-boot外部化数据源配置? - How can i externalize datasource configuration with spring-boot? 如何完全禁用与Spring Boot数据库相关的配置 - How can I completely disable the Spring Boot database related configuration 当我添加 Spring 批处理配置时,出现错误 - When I add Spring batch configuration I get error 如何在Spring Boot应用程序中使用配置(properties / yml)文件中的属性? - How can I use properties from a configuration (properties/yml) file in my Spring Boot application?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM