I have a multi module spring boot project. Each module has its own controller with N endpoints. I would like to be able to create jar with different endpoints based on the profile used during the build, perhaps with Maven profiles. Whereas I don't want to exclude a whole controller but only some controller endpoints.
I know that maybe this thing can be done using the spring profile. But with using spring profiles, it means that the jar would always have all the endpoints. I want to remove them completely and not "hide" them. Once the jar is created with a certain profile, the endpoints ignored by that profile must not be accessible.
Is there a possibility to do this or do I have to create separate branches?
Thank you