I have an interface as shown below:
@Service public interface MyService { }
And two implementing it:
@Component @Profile("dev") public class DevImplementation implements MyService { }
and
@Component @Profile("prod") public class ProdImplementation implements MyService { }
And another service is trying to use it:
@Service public MyClass { @Autowire MyService myservice; }
The problem is that I NoSuchBeanException when I run the code. It starts with
mvn spring-boot:run -P dev
What am I doing wrong?
shyam source share