Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.github.geekuniversity_java_215.cmsbackend.....;
- import org.springframework.context.annotation.Configuration;
- import org.springframework.context.annotation.Profile;
- import org.springframework.context.annotation.PropertySource;
- @Configuration
- public class My<.....>PropertiesConfiguration {
- @Configuration
- @Profile("default")
- @PropertySource(value ={
- "classpath:<...>.properties"},
- ignoreResourceNotFound=false)
- static class DefaultProperties {}
- @Configuration
- @Profile("!default")
- @PropertySource(value = {
- "classpath:<...>-${spring.profiles.active}.properties"},
- ignoreResourceNotFound=false)
- static class NonDefaultProperties {}
- }
Advertisement
Add Comment
Please, Sign In to add comment