- Kotlin for Enterprise Applications using Java EE
- Raghavendra Rao K
- 97字
- 2021-06-10 18:49:30
Using the kotlin-spring plugin in Gradle
In Gradle, the kotlin-spring compiler plugin can be enabled by using buildscript with the allopen artifact, as shown here:
buildscript {
dependencies {
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version"
}
}
apply plugin: "kotlin-spring"
Alternatively, the plugin can be enabled using plugins as follows:
plugins {
id "org.jetbrains.kotlin.plugin.spring" version "1.2.41"
}
This plugin specifies the following annotations:
- @Component
- @Transactional
- @Async
- @Cacheable
- @SpringBootTest
The classes that are annotated with these annotations are made open and accessible to the Spring framework so that we can create proxy objects.
推薦閱讀
- Hands-On Microservices with Kotlin
- 數據結構與算法分析(C++語言版)
- Microsoft Azure Storage Essentials
- Mastering Akka
- 一本書講透Java線程:原理與實踐
- Deep Learning with R Cookbook
- Hacking Android
- 數字媒體技術概論
- Qt 5.12實戰
- VMware vSphere Design Essentials
- Learn Linux Quickly
- Microsoft Windows Identity Foundation Cookbook
- 第五空間戰略:大國間的網絡博弈
- Java Web應用開發
- WCF編程(第2版)