GraalVM Native
Kora creates its helper classes at compile time, so there should be no problem building a native image.
An example of building a native image using plugin for gradle
:
Plugin build.gradle
:
Plugin setup build.gradle
:
graalvmNative {
binaries {
main {
imageName = "application"
mainClass = "ru.tinkoff.kora.example.Application"
debug = true
verbose = true
buildArgs.add("--report-unsupported-elements-at-runtime")
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(17)
vendor = JvmVendorSpec.matching("GraalVM Community")
}
}
}
metadataRepository {
enabled = true
}
}
Plugin build.gradle.kts
:
Plugin setup build.gradle.kts
:
graalvmNative {
binaries {
named("main") {
imageName.set("application")
mainClass.set("ru.tinkoff.kora.example.Application")
debug.set(true)
verbose.set(true)
buildArgs.add("--report-unsupported-elements-at-runtime")
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(17)
vendor = JvmVendorSpec.matching("GraalVM Community")
}
}
}
metadataRepository {
enabled.set(true)
}
}
Some libraries require additional configuration, some configurations are made in the framework.
Tested modules that should work without additional configuration:
- Configuration
- Json
- Logback
- Probes
- Metrics
- Tracing
- HTTP server
- HTTP client
- OpenAPI generation
- OpenAPI mapping
- JDBC (Postgres) database
- R2DBC (Postgres) database
- Database Vertx (Postgres)
- Cassandra database](database-cassandra.md)
- Kafka
- gRPC Server
- gRPC client
- resilient
- Cache
- Validation
- Scheduling
- Logging