dreamworker

Untitled

May 6th, 2020
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 KB | None | 0 0
  1. package com.github.geekuniversity_java_215.cmsbackend.....;
  2.  
  3. import org.springframework.context.annotation.Configuration;
  4. import org.springframework.context.annotation.Profile;
  5. import org.springframework.context.annotation.PropertySource;
  6.  
  7. @Configuration
  8. public class My<.....>PropertiesConfiguration {
  9.  
  10.     @Configuration
  11.     @Profile("default")
  12.     @PropertySource(value ={
  13.         "classpath:<...>.properties"},
  14.         ignoreResourceNotFound=false)
  15.     static class DefaultProperties {}
  16.  
  17.     @Configuration
  18.     @Profile("!default")
  19.     @PropertySource(value = {
  20.         "classpath:<...>-${spring.profiles.active}.properties"},
  21.         ignoreResourceNotFound=false)
  22.     static class NonDefaultProperties {}
  23. }
Advertisement
Add Comment
Please, Sign In to add comment