I have two gradle modules: common and app
The common module contains a JpaRepository named OutboxJpaMessageRepository.
The app module contains another JpaRepository named RentRepository.
The common has the following configuration class, which is auto-imported by the other module (using a spring.factories file):
@Configuration
@EntityScan("path.to.common.module")
@EnableJpaRepositories("path.to.common.module")
@ComponentScan("path.to.common.module")
public class OutboxMessagingAutoConfig {
}
The problem is that @EnableJpaRepositories("path.to.common.module") overrides the default auto-configuration of the application, and the app can't find RentRepository (different package).
Can a library exports jpa repositories without override the default configuration of the client?
I don't want to re-configure all apps which use the common module