Currently using Maven + Spring Boot. Our solution was the following:
application.properties
#spring.profiles.active= # comment_out or remove
securityConfig.java
@Value(${spring.profiles.active:[default_profile_name]}")
private String ACTIVE_PROFILE_NAME;
Credit starts with MartinMlima. Similar answer provided here:
How do you get current active/default Environment profile programmatically in Spring?