Java Spring Boot does not find Kotlin Components

Viewed 22

I have a mixed Java/Kotlin project that does use @SpringBootApplication and @EnableJPARepositories for JPA Repositories and Spring at the main class.

The java source code is located below src/main/java and the kotlin source code is located below src/main/kotlin.

However, Spring does only find components located in the java folder and does not register any components that are located in the kotlin folder. However, manually importing for example rest controllers using @Import works.

I guess this issue has something to do with @ComponentScan. However, both Kotlin and Java files share the same package.

How can I simultaneously use Kotlin and Java files with Spring's Autoconfigure?

0 Answers
Related