https://github.com/mvysny/vok-helloworld-app修改内容
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" }
分类:
kotlin
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!