2

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:

  1. 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.
  2. 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.

1 Answer 1

0

I see no reason it would not work.

Did you check that your component-scan is actually scanning your new classes ?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.