@@ -8,26 +8,25 @@ with existing libraries written in Java.
8
8
9
9
The Spring Framework provides first-class support for Kotlin and lets developers write
10
10
Kotlin applications almost as if the Spring Framework was a native Kotlin framework.
11
+ Most of the code samples of the reference documentation are
12
+ provided in Kotlin in addition to Java.
11
13
12
14
The easiest way to build a Spring application with Kotlin is to leverage Spring Boot and
13
15
its https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-kotlin.html[dedicated Kotlin support].
14
16
https://spring.io/guides/tutorials/spring-boot-kotlin/[This comprehensive tutorial]
15
17
will teach you how to build Spring Boot applications with Kotlin using https://start.spring.io/#!language=kotlin&type=gradle-project[start.spring.io].
16
18
17
- As of Spring Framework 5.2, most of the code samples of the reference documentation are
18
- provided in Kotlin in addition to Java.
19
-
20
19
Feel free to join the #spring channel of https://slack.kotlinlang.org/[Kotlin Slack]
21
20
or ask a question with `spring` and `kotlin` as tags on
22
21
https://stackoverflow.com/questions/tagged/spring+kotlin[Stackoverflow] if you need support.
23
22
24
23
[[kotlin-requirements]]
25
24
== Requirements
26
25
27
- Spring Framework supports Kotlin 1.3 and requires
28
- https://bintray.com/bintray/jcenter/ org.jetbrains.kotlin%3Akotlin -stdlib[`kotlin-stdlib`]
29
- (or one of its variants, such as https://bintray.com/bintray/jcenter/ org.jetbrains.kotlin%3Akotlin -stdlib-jdk8[`kotlin-stdlib-jdk8`])
30
- and https://bintray.com/bintray/jcenter/ org.jetbrains.kotlin%3Akotlin -reflect[`kotlin-reflect`]
26
+ Spring Framework supports Kotlin 1.3+ and requires
27
+ https://search.maven.org/artifact/ org.jetbrains.kotlin/kotlin -stdlib[`kotlin-stdlib`]
28
+ (or one of its variants, such as https://search.maven.org/artifact/ org.jetbrains.kotlin/kotlin -stdlib-jdk8[`kotlin-stdlib-jdk8`])
29
+ and https://search.maven.org/artifact/ org.jetbrains.kotlin/kotlin -reflect[`kotlin-reflect`]
31
30
to be present on the classpath. They are provided by default if you bootstrap a Kotlin project on
32
31
https://start.spring.io/#!language=kotlin&type=gradle-project[start.spring.io].
33
32
@@ -344,16 +343,15 @@ Spring Framework provides a
344
343
https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/servlet/view/script/ScriptTemplateView.html[`ScriptTemplateView`]
345
344
which supports https://www.jcp.org/en/jsr/detail?id=223[JSR-223] to render templates by using script engines.
346
345
347
- By leveraging `kotlin-script-runtime` and ` scripting-jsr223-embeddable ` dependencies, it
346
+ By leveraging `scripting-jsr223` dependencies, it
348
347
is possible to use such feature to render Kotlin-based templates with
349
348
https://github.com/Kotlin/kotlinx.html[kotlinx.html] DSL or Kotlin multiline interpolated `String`.
350
349
351
350
`build.gradle.kts`
352
351
[source,kotlin,indent=0]
353
352
----
354
353
dependencies {
355
- compile("org.jetbrains.kotlin:kotlin-script-runtime:${kotlinVersion}")
356
- runtime("org.jetbrains.kotlin:kotlin-scripting-jsr223-embeddable:${kotlinVersion}")
354
+ runtime("org.jetbrains.kotlin:kotlin-scripting-jsr223:${kotlinVersion}")
357
355
}
358
356
----
359
357
0 commit comments