me.paulschwarz.springdotenv.DotenvApplicationInitializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-dotenv Show documentation
Show all versions of spring-dotenv Show documentation
Provides a Dotenv property source for Spring and Spring Boot
package me.paulschwarz.springdotenv;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;
public class DotenvApplicationInitializer implements ApplicationContextInitializer {
/**
* Initialize the given application context.
*
* @param applicationContext the application to configure
*/
@Override
public void initialize(final ConfigurableApplicationContext applicationContext) {
DotenvPropertySource.addToEnvironment(applicationContext.getEnvironment());
}
}