We have several classes annotated with the @Component
notation in our Spring Boot 2.x project - but we would like to selectively pick only one of these class at runtime.
To further elaborate we created a Uber Jar - which will run on several machines - but each jar should be running a different logic and this logic is dictated by one of this class.
What is the cleanest way to achieve this in Spring boot 2.x? I read something about profiles etc. any cleaner solutions are very much appreciated.