I have an interface define as below:
public interface MyService {
}
And two classes implementing it:
@Service
@Profile("dev")
public class DevImplementation implements MyService {
}
and
@Service
@Profile("prod")
public class ProdImplementation implements MyService {
}
And there's another service trying to use it:
@Service
public MyClass {
@Autowired
MyService myservice;
}
The problem is that I'm getting NoSuchBeanException
when running the code. It's run using
mvn spring-boot:run -P dev
What am I doing wrong?