Fragment implementations no longer found after upgrading to 2.1.x.RELEASE [DATACMNS-1487] #1922
Labels
in: repository
Repositories abstraction
status: declined
A suggestion or change that we don't feel we should currently apply
type: bug
A general bug
Paul Warren opened DATACMNS-1487 and commented
I have a library that adds versioning to spring data repositories via a re-usable fragment. Developers make their repository extend my fragment VersioningRepository and they can then version their entities.
Currently I support Spring Data Commons 2.0.x.RELEASE. With this release when a Developer extends my VersioningRepository fragment the implementation is found because, I believe, this method uses FragmentMetadata.getBasePackages() that returns the package of the fragment interface and as the implementation is in the same/sub package the classpath scan finds it.
However, with the 2.1.0.RELEASE release the implementation is not found because, I believe, this commit changed the scanning algorithm that now seems to use the "base package" specifications on the
@EnableXYZRepositories
annotations.This means, to use my fragment Developers have to also specify my fragment's package in their
@EnableJpaRepositories
annotation (for example). Or, if they are using Spring Boot and don't specify this annotation at all, the fragment implementation just isn't found.I have reproduced the problem with this repo.
Affects: 2.1.5 (Lovelace SR5)
Reference URL: https://github.com/paulcwarren/DATACMNS-1487
The text was updated successfully, but these errors were encountered: