Skip to content

Commit

Permalink
java.lang.ClassNotFoundException: kotlin.reflect.full.KClasses when u…
Browse files Browse the repository at this point in the history
…pgrade from 2.7.0 to 2.8.0. Fixes #2834
  • Loading branch information
bnasslahsen committed Jan 6, 2025
1 parent 0dc9dcf commit ecb3782
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
5 changes: 5 additions & 0 deletions springdoc-openapi-starter-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@
<artifactId>kotlinx-coroutines-reactor</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
<scope>provided</scope>
</dependency>
<!-- Spring Web /Data Rest/Hateoas && For Enhanced Pageable Support-->
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,15 @@ class SpringDocKotlinConfiguration() {
return kotlinFunction.parameters[parameterIndex + 1]
}

@Bean
@Lazy(false)
@ConditionalOnMissingBean
fun kotlinDeprecatedPropertyCustomizer(objectMapperProvider: ObjectMapperProvider): KotlinDeprecatedPropertyCustomizer {
return KotlinDeprecatedPropertyCustomizer(objectMapperProvider)
@ConditionalOnClass(name = ["kotlin.reflect.full.KClasses"])
class KotlinReflectDependingConfiguration {

@Bean
@Lazy(false)
@ConditionalOnMissingBean
fun kotlinDeprecatedPropertyCustomizer(objectMapperProvider: ObjectMapperProvider): KotlinDeprecatedPropertyCustomizer {
return KotlinDeprecatedPropertyCustomizer(objectMapperProvider)
}
}

}

0 comments on commit ecb3782

Please # to comment.