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

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. 

主站蜘蛛池模板: 乡城县| 昌吉市| 东平县| 吴江市| 普安县| 峡江县| 盐津县| 卫辉市| 东阿县| 南安市| 庆阳市| 福海县| 长顺县| 绍兴市| 汉中市| 灵丘县| 澄迈县| 石城县| 梁平县| 巫溪县| 彭泽县| 金门县| 上饶县| 威宁| 顺义区| 吉安县| 理塘县| 榆林市| 广平县| 赞皇县| 平江县| 兰坪| 新兴县| 灯塔市| 金寨县| 毕节市| 农安县| 阿坝县| 监利县| 宁海县| 碌曲县|