Created
April 24, 2021 19:15
-
-
Save sandipchitale/af1e4607f63f2bce9bedbcbf04e581b0 to your computer and use it in GitHub Desktop.
Dump all bean names #springboot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component | |
public class CommandLineAppStartupRunner implements CommandLineRunner, ApplicationContextAware { | |
private ApplicationContext applicationContext; | |
@Override | |
public void run(String... args) throws Exception { | |
String[] beanNames = this.applicationContext.getBeanDefinitionNames(); | |
Arrays.stream(beanNames).forEach((beanName) -> { | |
System.out.println(beanName); | |
}); | |
} | |
@Override | |
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { | |
this.applicationContext = applicationContext; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment