Сборщик Gradle для kotlin "kapt" не запускает mapstruct-processor в итоге валятся тесты
у меня в проекте используется kotlin
gradle
файл:
import org.jetbrains.kotlin.gradle.utils.extendsFrom
val snapshotsRepo: String by project
val releasesRepo: String by project
val nexusUser: String by project
val nexusPassword: String by project
plugins {
kotlin("plugin.spring")
kotlin("jvm") version "1.9.23"
kotlin("kapt")
}
val versionOfCommonProtobufSchemas: String = "0.0.1.BM-20378-20250210.053817-24"
configurations {
testImplementation.extendsFrom(compileOnly)
}
dependencies {
// Annotation processors
implementation("org.mapstruct.extensions.spring:mapstruct-spring-annotations:0.1.2")
implementation("org.mapstruct:mapstruct:1.5.3.Final")
kapt("org.mapstruct:mapstruct-processor:1.5.3.Final")
// Spring starters
compileOnly("org.springframework.boot:spring-boot-starter-webflux")
//Swagger & API docs
compileOnly("org.springdoc:springdoc-openapi-starter-webflux-ui")
// Validation
compileOnly("org.springframework.boot:spring-boot-starter-validation")
// gRPC
compileOnly("io.grpc:grpc-netty")
compileOnly("io.grpc:grpc-protobuf")
compileOnly("io.grpc:grpc-stub")
compileOnly("io.grpc:grpc-kotlin-stub")
compileOnly("com.google.protobuf:protobuf-java-util")
compileOnly("com.google.protobuf:protobuf-kotlin")
compileOnly("javax.annotation:javax.annotation-api")
compileOnly(group = "org.springframework.boot", name = "spring-boot-configuration-processor")
kapt(group = "org.springframework.boot", name = "spring-boot-configuration-processor")
kapt("org.springframework.boot:spring-boot-configuration-processor")
// kotlin
compileOnly(kotlin("stdlib-jdk8"))
// Coroutines
compileOnly("org.jetbrains.kotlinx:kotlinx-coroutines-core")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test")
// Testing
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.mockito.kotlin:mockito-kotlin")
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting")
implementation(project(":common"))
testImplementation("org.mapstruct.extensions.spring:mapstruct-spring-annotations:0.1.2")
testImplementation("org.mapstruct:mapstruct:1.5.3.Final")
kaptTest("org.mapstruct:mapstruct-processor:1.5.3.Final")
}
tasks {
extractProtoschemas {
protoFolders.addAll(
"ndfl-calculation",
)
}
}
kapt {
correctErrorTypes = true
useBuildCache = true
showProcessorStats = true
includeCompileClasspath = true
keepJavacAnnotationProcessors = true
arguments {
arg("mapstruct.defaultComponentModel", "spring")
arg("mapstruct.defaultInjectionStrategy", "constructor")
}
}
после сборки - падает ошибка на стадии тестирования, не может найти файлы сгенерированные мапстрактом
project/build/generated/source/kapt/main
- пусто
project/build/generated/source/kapt/test
- пусто
пустые