Use 'kotlin-spring' gradle plugin

This commit is contained in:
Gary Russell
2018-04-30 16:52:33 -04:00
parent daebf40a69
commit 0fce70da1d
2 changed files with 7 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
buildscript {
ext.kotlinVersion = '1.2.40'
ext.kotlinVersion = '1.2.41'
repositories {
maven { url 'https://repo.spring.io/plugins-release' }
}
@@ -8,6 +8,7 @@ buildscript {
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.3'
classpath 'me.champeau.gradle:gradle-javadoc-hotfix-plugin:0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlinVersion"
}
}
@@ -236,6 +237,7 @@ project('spring-rabbit') {
description = 'Spring RabbitMQ Support'
apply plugin: 'kotlin'
apply plugin: 'kotlin-spring'
dependencies {

View File

@@ -57,7 +57,7 @@ class EnableRabbitKotlinTests {
@Configuration
@EnableRabbit
open class Config {
class Config {
val latch = CountDownLatch(1)
@@ -67,17 +67,18 @@ class EnableRabbitKotlinTests {
}
@Bean
open fun rabbitListenerContainerFactory(cf: CachingConnectionFactory): SimpleRabbitListenerContainerFactory {
fun rabbitListenerContainerFactory(cf: CachingConnectionFactory): SimpleRabbitListenerContainerFactory {
val factory = SimpleRabbitListenerContainerFactory()
factory.setConnectionFactory(cf)
return factory
}
@Bean
open fun cf(): CachingConnectionFactory {
fun cf(): CachingConnectionFactory {
return CachingConnectionFactory(
RabbitAvailableCondition.getBrokerRunning().connectionFactory)
}
}
}