My applications normally uses Spring framework and Maven for the build/deploy process. In Maven 3 is possible to create profiles but I find it not very usefull because if you want to create application properties dynamically then you need to use ant plugins, so I found another way: using Spring Profiles (avaliable from Spring 3.1).
First of all you need to add the following dependency: Here goes the configuration of the properties that are loaded during the deploy: To retrive a property in your Object just do the following: To make this work you just make sure to set spring.profiles.active variable in your environment somewhere, or add the following parameter in tomcat -Dspring.profiles.active="
No comments:
Post a Comment