Spring @DependsOn Annotation
Sometimes dependencies between beans may not be direct but you may still want to ensure that a specific bean is initialized before another bean. For example in one bean there is a static block which has to be executed before another bean is initialized. You can use Spring @DependsOn annotation…