Spring boot external application.properties

前端 未结 5 678
长发绾君心
长发绾君心 2020-12-15 22:20

I am developing a spring boot application

I want to override some properties in src/main/resources/application.properties with an external file (e.g.

5条回答
  •  [愿得一人]
    2020-12-15 22:45

    Note: The following solution will replace the old application.properties entirely

    You can place your application.properties in one of the following locations:

    • Under /config sub-directory of the current directory
    • The current directory
    • A classpath /config package
    • The classpath root

    And then exclude the default one under resources directory, like:

    
        
            
                src/main/resources
                true
                
                    **/application.properties
                
            
        
    
    

    Find more details in this link

提交回复
热议问题