IT

Spring boot를 사용하여 프로그래밍 방식으로 현재 활성 프로필을 결정하는 방법

lottoking 2020. 8. 25. 08:20
반응형

Spring boot를 사용하여 프로그래밍 방식으로 현재 활성 프로필을 결정하는 방법 [중복]


내 빈 내에서 현재 활성 프로필을 프로그래밍 방식으로 가져 오는 방법이 있습니까?


앱 부팅 또는 원시 Spring은 중요하지 않습니다. org.springframework.core.env.Environment에 충분 하기에 충분합니다 .

@Autowired
private Environment environment;
....

this.environment.getActiveProfiles();

참고 URL : https://stackoverflow.com/questions/28392231/how-to-determine-programmatically-the-current-active-profile-using-spring-boot

반응형