From cc8cf7be88b1b409a6f5f6247b88ec3385ed6cae Mon Sep 17 00:00:00 2001 From: lorenzsimon Date: Thu, 23 Nov 2023 20:19:21 +0100 Subject: [PATCH] fix Autoconfig migration --- kotlin-asyncapi-spring-web/pom.xml | 12 ++++++++++++ .../springweb/AsyncApiAutoConfiguration.kt | 3 ++- .../src/main/resources/META-INF/spring.factories | 2 -- ...ork.boot.autoconfigure.AutoConfiguration.imports | 1 + pom.xml | 13 +++++++++++++ 5 files changed, 28 insertions(+), 3 deletions(-) delete mode 100644 kotlin-asyncapi-spring-web/src/main/resources/META-INF/spring.factories create mode 100644 kotlin-asyncapi-spring-web/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports diff --git a/kotlin-asyncapi-spring-web/pom.xml b/kotlin-asyncapi-spring-web/pom.xml index d555bac..5b07218 100644 --- a/kotlin-asyncapi-spring-web/pom.xml +++ b/kotlin-asyncapi-spring-web/pom.xml @@ -78,12 +78,24 @@ spring-boot-starter-test 3.2.0 test + + + spring-boot-starter-logging + org.springframework.boot + + org.springframework.boot spring-boot-starter-web 3.2.0 test + + + spring-boot-starter-logging + org.springframework.boot + + diff --git a/kotlin-asyncapi-spring-web/src/main/kotlin/org/openfolder/kotlinasyncapi/springweb/AsyncApiAutoConfiguration.kt b/kotlin-asyncapi-spring-web/src/main/kotlin/org/openfolder/kotlinasyncapi/springweb/AsyncApiAutoConfiguration.kt index 22be7a9..9a90cef 100644 --- a/kotlin-asyncapi-spring-web/src/main/kotlin/org/openfolder/kotlinasyncapi/springweb/AsyncApiAutoConfiguration.kt +++ b/kotlin-asyncapi-spring-web/src/main/kotlin/org/openfolder/kotlinasyncapi/springweb/AsyncApiAutoConfiguration.kt @@ -19,6 +19,7 @@ import org.openfolder.kotlinasyncapi.springweb.service.AsyncApiSerializer import org.openfolder.kotlinasyncapi.springweb.service.AsyncApiService import org.openfolder.kotlinasyncapi.springweb.service.DefaultAsyncApiSerializer import org.openfolder.kotlinasyncapi.springweb.service.DefaultAsyncApiService +import org.springframework.boot.autoconfigure.AutoConfiguration import org.springframework.boot.autoconfigure.condition.ConditionalOnBean import org.springframework.boot.autoconfigure.condition.ConditionalOnClass import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean @@ -32,7 +33,7 @@ import kotlin.reflect.KClass import kotlin.script.experimental.host.toScriptSource import kotlin.script.experimental.jvmhost.BasicJvmScriptingHost -@Configuration +@AutoConfiguration @ConditionalOnBean(AsyncApiMarkerConfiguration.Marker::class) @Import(AsyncApiScriptAutoConfiguration::class, AsyncApiAnnotationAutoConfiguration::class) internal open class AsyncApiAutoConfiguration { diff --git a/kotlin-asyncapi-spring-web/src/main/resources/META-INF/spring.factories b/kotlin-asyncapi-spring-web/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 40fffd1..0000000 --- a/kotlin-asyncapi-spring-web/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,2 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - org.openfolder.kotlinasyncapi.springweb.AsyncApiAutoConfiguration \ No newline at end of file diff --git a/kotlin-asyncapi-spring-web/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/kotlin-asyncapi-spring-web/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..cfd19cf --- /dev/null +++ b/kotlin-asyncapi-spring-web/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +org.openfolder.kotlinasyncapi.springweb.AsyncApiAutoConfiguration \ No newline at end of file diff --git a/pom.xml b/pom.xml index 1960a4d..cb5b4da 100644 --- a/pom.xml +++ b/pom.xml @@ -56,6 +56,7 @@ 4.8.163 1.12.3 1.5.1 + 5.10.1 3.24.2 @@ -273,6 +274,18 @@ kotlin-scripting-jvm-host ${kotlin.version} + + org.junit.jupiter + junit-jupiter-api + ${junit-jupiter.version} + test + + + org.junit.jupiter + junit-jupiter-engine + ${junit-jupiter.version} + test + org.skyscreamer jsonassert