Closed jabrena closed 1 year ago
ConfigurableApplicationContext ctx = SpringApplication.run(ProxyApplication.class, args); BeanDefinitionRegistry registry = (BeanDefinitionRegistry) ctx.getAutowireCapableBeanFactory(); for(String beanName : ctx.getBeanDefinitionNames()){ System.out.println(beanName); registry.removeBeanDefinition(beanName); }
https://stackoverflow.com/questions/38793661/removing-spring-beans-from-application-context
https://chat.openai.com/share/65a0a5eb-2ac7-478b-87d9-7a62b3471ab2
Bad practice
https://github.com/jabrena/spring-boot-user-beans/issues/120
https://stackoverflow.com/questions/38793661/removing-spring-beans-from-application-context