sts4 icon indicating copy to clipboard operation
sts4 copied to clipboard

It does not run a spring boot kotlin project, it does not even recorgnised the kotlin items

Open webdroid21 opened this issue 4 months ago • 2 comments

Describe the bug I setup my project perfectly with kotlin as my programming language and now i can seen to run it nor view the endpoints and all the other features

To Reproduce Setup a spring boot project using kotlin as your programing language

Sample

plugins { kotlin("jvm") version "1.9.25" kotlin("plugin.spring") version "1.9.25" id("org.springframework.boot") version "3.5.4" id("io.spring.dependency-management") version "1.1.7" id("org.asciidoctor.jvm.convert") version "3.3.2" kotlin("plugin.jpa") version "1.9.25" kotlin("kapt") version "1.9.25" }

group = "com.example" version = "0.0.1-SNAPSHOT" description = "name"

java { toolchain { languageVersion = JavaLanguageVersion.of(21) } }

configurations { compileOnly { extendsFrom(configurations.annotationProcessor.get()) } }

repositories { mavenCentral() }

extra["snippetsDir"] = file("build/generated-snippets")

dependencies { implementation("org.springframework.boot:spring-boot-starter-actuator") implementation("org.springframework.boot:spring-boot-starter-data-jpa") implementation("org.springframework.boot:spring-boot-starter-freemarker") implementation("org.springframework.boot:spring-boot-starter-graphql") implementation("org.springframework.boot:spring-boot-starter-mail") implementation("org.springframework.boot:spring-boot-starter-oauth2-client") implementation("org.springframework.boot:spring-boot-starter-security") implementation("org.springframework.boot:spring-boot-starter-web") implementation("org.springframework.boot:spring-boot-starter-websocket") implementation("org.springframework.boot:spring-boot-starter-aop") implementation("org.springframework.boot:spring-boot-starter-data-redis") implementation("org.springframework.boot:spring-boot-starter-validation") implementation("org.springframework.boot:spring-boot-starter-oauth2-resource-server") implementation("com.fasterxml.jackson.module:jackson-module-kotlin") implementation("org.jetbrains.kotlin:kotlin-reflect") implementation("org.liquibase:liquibase-core") implementation("com.nimbusds:nimbus-jose-jwt:9.37.3") compileOnly("org.projectlombok:lombok") developmentOnly("org.springframework.boot:spring-boot-docker-compose") runtimeOnly("org.postgresql:postgresql") annotationProcessor("org.projectlombok:lombok") kapt("org.springframework.boot:spring-boot-configuration-processor") testImplementation("org.springframework.boot:spring-boot-starter-test") testImplementation("org.jetbrains.kotlin:kotlin-test-junit5") testImplementation("org.springframework.graphql:spring-graphql-test") testImplementation("org.springframework.restdocs:spring-restdocs-mockmvc") testImplementation("org.springframework.security:spring-security-test") testImplementation("org.testcontainers:postgresql:1.20.1") testImplementation("org.testcontainers:junit-jupiter:1.20.1") testRuntimeOnly("org.junit.platform:junit-platform-launcher") }

kotlin { compilerOptions { freeCompilerArgs.addAll("-Xjsr305=strict") } }

allOpen { annotation("jakarta.persistence.Entity") annotation("jakarta.persistence.MappedSuperclass") annotation("jakarta.persistence.Embeddable") }

tasks.withType<Test> { useJUnitPlatform() }

tasks.test { outputs.dir(project.extra["snippetsDir"]!!) }

tasks.asciidoctor { inputs.dir(project.extra["snippetsDir"]!!) dependsOn(tasks.test) }

Image

webdroid21 avatar Aug 15 '25 23:08 webdroid21

I don't think we were hoping to support Kotlin right out of the box. We had some vague plans to support Kotlin but don't think we'v been able to make these plans concrete... If you have a git repo with the sample project that would be helpful of course. Perhaps, we could make something simple working for Kotlin... like showing the beans available at runtime... However, all static analysis tools like symbols, content assist, reconciling, navigation in Kotlin code will generally be unavailable.

BoykoAlex avatar Aug 16 '25 20:08 BoykoAlex

Interesting: Jetbrains is working on a language server for Kotlin, plus corresponding VSCode extension: https://github.com/Kotlin/kotlin-lsp/tree/main. Maybe this opens the door for some integration here.

martinlippert avatar Aug 18 '25 10:08 martinlippert