mvn -P dev
If I build my project using profile dev, then I want to use dev.properties in my spring bean like below. Is it possible ? If so , how could
Create a properties file that will be populated using Maven's resource filtering that specifies the profile you are using at build time.
build.properties
activatedProfile=${profileId}
pom.xml (You don't need to filter the complete directory, customise as required)
src/main/resources
true
Add a profileId
(or whatever you want to call it) property under each different profile:
dev
dev
qa
qa
You can then use ${activatedProfile}.properties
as value for a bean