Merge pull request #7177 from amit2103/BAEL-14274-10
[BAEL-14274] - Fixed article code for https://www.baeldung.com/spring…
This commit is contained in:
commit
bdc822dc26
|
@ -0,0 +1,18 @@
|
|||
package org.baeldung.startup;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class ProfileManager {
|
||||
|
||||
@Autowired
|
||||
private Environment environment;
|
||||
|
||||
public void getActiveProfiles() {
|
||||
for (final String profileName : environment.getActiveProfiles()) {
|
||||
System.out.println("Currently active profile - " + profileName);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue