mardi 16 juin 2020

Can a class library reflectively access packages outside of itself when added to a project?

I'm making a very basic ORM using Spring JDBC. The very foundation of it works by giving it a package name containing entities as part of a YAML config file which it then scans using the Reflections library and generates RowMapper implementations for each of them using ByteBuddy. This works perfectly when running my tests directly from my ORM class library. The issue arises when adding my ORM class library as a maven dependency to another project (as one would do for Spring Data JPA for example). I have moved my entities from the ORM project itself to the separate test project and, ever since doing this, Reflections cannot find the entities (nor the package by the looks of things).

My question is this : Is it even possible for a class library to (reflectively) find packages/classes outside of itself when added as a dependency to another project? If not, how does Spring Data JPA work?





Aucun commentaire:

Enregistrer un commentaire