Currently I have a Spring Web Application built using Spring Boot that exposes some restful endpoints using Spring Data REST.
What I can't figure out is how to allow my web application to load new entities, repositories and controllers at application start up. I would want to be able to build new classes into a separate jar and place it into a plugins folder and have their annotations scanned just like the new classes were part of the main application.
An example would be having a jar with two components:
- A class annotated with @Entity that directly maps to a database table and having a CrudRepository. It would be declared in the same package as the entities in the main project.
- An interface for that entity that is annotated with @RepositoryRestResouce. It would be declared in the same package as the repositories in the main project.