Closed Enaium closed 1 year ago
没有stacktrace?
Please provide related information of gradle.build
Please provide related information of
gradle.build
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("org.springframework.boot") version "2.7.0"
id("io.spring.dependency-management") version "1.0.12.RELEASE"
kotlin("jvm") version "1.9.0"
kotlin("kapt") version "1.9.0"
kotlin("plugin.spring") version "1.9.0"
id("com.google.devtools.ksp") version "1.9.0-1.0.12"
}
val jimmerVersion = "0.7.130"
group = "org.babyfish.jimmer.example.kt"
version = jimmerVersion
java.sourceCompatibility = JavaVersion.VERSION_1_8
repositories {
mavenCentral()
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.data:spring-data-redis")
implementation("org.springframework.kafka:spring-kafka:2.9.0")
implementation("org.apache.kafka:connect-api:0.10.0.0")
implementation("org.babyfish.jimmer:jimmer-spring-boot-starter:${jimmerVersion}")
ksp("org.babyfish.jimmer:jimmer-ksp:${jimmerVersion}")
implementation("org.mapstruct:mapstruct:1.5.3.Final")
kapt("org.mapstruct:mapstruct-processor:1.5.3.Final")
kapt("org.babyfish.jimmer:jimmer-mapstruct-apt:${jimmerVersion}")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.springdoc:springdoc-openapi-ui:1.6.11")
runtimeOnly("com.h2database:h2:2.1.212")
runtimeOnly("mysql:mysql-connector-java:8.0.30")
runtimeOnly("org.postgresql:postgresql:42.6.0")
runtimeOnly("io.lettuce:lettuce-core:6.2.0.RELEASE")
runtimeOnly("com.github.ben-manes.caffeine:caffeine:2.9.1")
testImplementation("org.springframework.boot:spring-boot-starter-test")
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "1.8"
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
我这边更离谱,注掉任何annotation prcoessor,单单引入kapt插件,就已经能game over了,kapt说ksp生成的文件不存在。
原因也很难找,你JDK啥版本?
JDK17和8都试过
Please change the order of your plugin declarations, the kapt
plugin must be declared AFTER ksp
plugin.
plugins {
id("org.springframework.boot") version "2.7.0"
id("io.spring.dependency-management") version "1.0.12.RELEASE"
kotlin("jvm") version "1.9.0"
- kotlin("kapt") version "1.9.0"
kotlin("plugin.spring") version "1.9.0"
id("com.google.devtools.ksp") version "1.9.0-1.0.12"
+ kotlin("kapt") version "1.9.0"
}
Please change the order of your plugin declarations, the
kapt
plugin must be declared AFTERksp
plugin.plugins { id("org.springframework.boot") version "2.7.0" id("io.spring.dependency-management") version "1.0.12.RELEASE" kotlin("jvm") version "1.9.0" - kotlin("kapt") version "1.9.0" kotlin("plugin.spring") version "1.9.0" id("com.google.devtools.ksp") version "1.9.0-1.0.12" + kotlin("kapt") version "1.9.0" }
thx
呀,我之前搞不定,现在又没功夫搞的问题,就这样消失了?
重构完后,加入文档注意事项
开启mapstruct.verbose