build.gradle.kts
:
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "2.1.0"
alias(libs.plugins.vaadin)
application
id("org.graalvm.buildtools.native") version "0.10.4"
}
defaultTasks("clean", "build")
repositories {
mavenCentral()
}
dependencies {
// Vaadin
implementation(libs.vok.db)
implementation(libs.vaadin.core) {
if (vaadin.effective.productionMode.get()) {
exclude(module = "vaadin-dev")
}
}
implementation(libs.vaadin.boot)
implementation(libs.hikaricp)
// logging
// currently we are logging through the SLF4J API to SLF4J-Simple. See src/main/resources/simplelogger.properties file for the logger configuration
implementation(libs.slf4j.simple)
// db
implementation(libs.flyway)
implementation(libs.h2)
// REST
implementation(libs.vok.rest)
// Kotlin
implementation(kotlin("stdlib-jdk8"))
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
tasks.withType<KotlinCompile> {
compilerOptions.jvmTarget = JvmTarget.JVM_17
}
tasks.withType<Jar> {
manifest {
attributes["Main-Class"] = "com.example.vok.MainKt"
}
}
tasks.withType<Test> {
useJUnitPlatform()
testLogging {
// to see the exception stacktraces of failed tests in CI
exceptionFormat = TestExceptionFormat.FULL
}
}
graalvmNative {
binaries.all {
resources.autodetect()
}
}
application {
mainClass.set("com.example.vok.MainKt")
}
gradle/libs.versions.toml
:
[versions]
vaadin = "24.6.0"
# https://repo1.maven.org/maven2/org/slf4j/slf4j-api/
slf4j = "2.0.16"
vok = "0.18"
[libraries]
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
slf4j-simple = { module = "org.slf4j:slf4j-simple", version.ref = "slf4j" }
jetbrains-annotations = "org.jetbrains:annotations:26.0.1"
vaadin-boot = "com.github.mvysny.vaadin-boot:vaadin-boot:13.3"
vaadin-core = { module = "com.vaadin:vaadin-core", version.ref = "vaadin" }
junit = "org.junit.jupiter:junit-jupiter-engine:5.11.4"
kaributesting = "com.github.mvysny.kaributesting:karibu-testing-v24:2.2.0"
vok-db = { module = "eu.vaadinonkotlin:vok-framework-vokdb", version.ref = "vok" }
vok-rest = {module = "eu.vaadinonkotlin:vok-rest", version.ref = "vok" }
flyway = "org.flywaydb:flyway-core:11.1.0"
h2 = "com.h2database:h2:2.3.232"
hikaricp = "com.zaxxer:HikariCP:6.2.1"
[plugins]
vaadin = { id = "com.vaadin", version.ref = "vaadin" }
标签:github,mvysny,app,vok,slf4j,libs,org,com,vaadin
From: https://www.cnblogs.com/soarowl/p/18619000