I am trying to write an autoconfigure / starter module for one of my project. This module handles the persistence through Spring Data JPA. It aims at providing several spring data repositories.
Right now, my autoconfiguration looks like this:
@Configuration(proxyBeanMethods = false)
@AutoConfigureAfter(JpaRepositoriesAutoConfiguration::class)
@EnableJpaRepositories(basePackageClasses = [ItemRepository::class])
@EntityScan(basePackageClasses = [ItemRepository::class])
class DomainPersistenceDataJpaAutoConfiguration() {
}
As stated in spring boot reference documentation, auto configuration should not enable component scanning, although @EnableJpaRepositories
uses component scanning.
What would be a good alternative approach? Is there any example of existing spring boot start which provides repositories implementation I could consult?