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

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. 

主站蜘蛛池模板: 班玛县| 万山特区| 彝良县| 永城市| 平罗县| 措勤县| 临城县| 信丰县| 乐至县| 台东县| 福建省| 巨野县| 满洲里市| 独山县| 阿图什市| 儋州市| 湟源县| 南开区| 丹棱县| 湘西| 思南县| 炎陵县| 贵南县| 夏邑县| 长沙市| 龙山县| 陈巴尔虎旗| 门源| 合作市| 娄烦县| 长汀县| 西乌珠穆沁旗| 菏泽市| 璧山县| 麦盖提县| 富顺县| 永登县| 赞皇县| 句容市| 兴国县| 化德县|