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

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. 

主站蜘蛛池模板: 铜山县| 樟树市| 南京市| 五指山市| 武隆县| 渝中区| 贵州省| 玉林市| 封开县| 武义县| 鹿泉市| 东莞市| 金乡县| 无棣县| 响水县| 沙坪坝区| 万载县| 阳江市| 临漳县| 濮阳县| 铁岭县| 江油市| 昌图县| 砀山县| 都兰县| 上栗县| 镇原县| 苍南县| 奇台县| SHOW| 方山县| 珲春市| 长垣县| 普定县| 天祝| 营口市| 扬州市| 武强县| 闵行区| 淳安县| 黑河市|