官术网_书友最值得收藏!

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. 

主站蜘蛛池模板: 汝南县| 永顺县| 独山县| 射阳县| 遂川县| 闽清县| 于都县| 淮安市| 永和县| 景泰县| 临桂县| 古田县| 美姑县| 聊城市| 张家川| 得荣县| 云阳县| 育儿| 夏邑县| 平塘县| 皋兰县| 淅川县| 从江县| 灵寿县| 南澳县| 甘孜| 池州市| 安化县| 凌海市| 吉安市| 郎溪县| 白玉县| 张家川| 环江| 高邑县| 旬阳县| 贵南县| 鹿泉市| 毕节市| 合肥市| 舒兰市|