Getting Started | Building web applications with Spring Boot and Kotlin

새 프로젝트 만들기

Kotlin-JPA Plugin = All-open compiler plugin

import org.springframework.stereotype.Service

@Service 
open class MyService {
	fun performService() {
	 //
	}
}
import org.springframework.stereotype.Service

@Service
class MyService {
    fun performService() {
        println("Service is being performed")
    }
}

import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
  id("org.springframework.boot") version "3.2.2"
  id("io.spring.dependency-management") version "1.1.4"
  kotlin("jvm") version "1.9.22"
  kotlin("plugin.spring") version "1.9.22"
  kotlin("plugin.jpa") version "1.9.22"
}

null-safety

tasks.withType<KotlinCompile> {
  kotlinOptions {
    freeCompilerArgs += "-Xjsr305=strict"
  }
}