CDI extension does not allow for existence of two different Spring data modules - checked for Spring Data Jpa and Solr, but it looks like the problem is general.
CDI extension looks for every interface extending Repository interface and registers a new repository bean for each found interface without checking the specific repository type related to a concrete Spring Data Module. Each Spring Data module registers a separate CDI extension and do the same processing, trying to register beans specific to that module but including interfaces that are designed for other modules, eg JpaRepositoryExtension processes an interface extending SolrRepository and SolrRepositoryExtension processes an interface extending JpaRepository.
We couldn't find any way to configure this process in CDI environment. We use a simple work around which works for Us but needs replacing files in jars (e.g. javax.enterprise.inject.spi.Extension and extension classes) and publishing fix artifacts when We need upgrade version of a Spring data module.
In the code We create a copy of extension class e.g. JpaRepositoryExtensionFix as a copy of JpaRepositoryExtension and make a small change in the method:
void afterBeanDiscovery(@Observes AfterBeanDiscovery afterBeanDiscovery, BeanManager beanManager)
we add additional check in the main loop:
final code is:
More generic solution could incldue changes in spring-data-commons – org.springframework.data.repository.cdi.CdiRepositoryExtensionSupport class, methods: isRepository, processAnnotatedType.
I have made a similar bug in Jpa module: DATAJPA-875.