How to create spring properties by condition?
java, spring, spring-boot
Solution
As Dave Syer already mentioned in his comment, it is possible to use profile specific property files to configure the application with Spring Boot. So in your `application.properties` you define the property with its default value, and in the file `application-test.properties` you define the property with default_name_test. The name pattern for the config files is `application-${profilename}.properties`.
See the Spring Boot manual here: http://docs.spring.io/spring-boot/docs/1.2.2.RELEASE/reference/htmlsingle/#boot-features-external-config-profile-specific-properties
Problem
Is it possible to create a `application.properties` property by condition? I want to define a filename that should be "default_name_test" if `spring.profiles.active=test`, and "default_name" otherwise. Pseudeocode: ``` #application.properties: filename=default_name${spring.profiles.active} = test ? "_test" : ""; ``` Is that possible at all?