I have dependency in my spring boot project which fetches values of some properties using Spring's EnvironmentPostProcessor. Now these properties are database credentials and not everyone has access to the credential since there is no dev environment for the db in question. I just want to change the configuration that the credentials don't get fetched on dev or local environment on application startup as that would result in a error and the application will fail to start.
Class A implements EnvironmentPostProcessor{}
I tried to use @Lazy annotation on the Class Annoteted with @ConfigurationProperties. I also tried using my own BeanFactoryPostProcessor (with @Order(HighestPrecedence) to programmatically set the A to lazy load, but it gets called before my BeanFactoryPostProcessor's postProcessBeanFactory method. Is what I'm trying to achieve possible and am I going about it the wrong way?