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:
Loredana Crusoveanu 2019-07-17 15:34:14 +03:00 committed by GitHub
commit bdc822dc26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 0 deletions

View File

@ -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);
}
}
}