I am using Maven inside Eclipse to build and deploy code. I have multiple profiles setup "production","dev" & "test" in the pom.xml. The question is, is there anyway I can get the currently using profile name/id (which is the one passed as the Maven Build Profiles param from Eclipse Run Configurations) from Spring MVC application.
I have tried autowiring org.springframework.core.env.Environment
and use getActiveProfiles()
as answered in another SO question but the String array returned is empty.