How to load only profile specific property file and ignore default application.properties?
问题 I have a normal spring boot application, and two property files in resources folder: application.properties com.example.prop1=value1 com.example.enableMock=true application-dev.properties com.example.prop1=value11 I have some logic based on whether com.example.enableMock is present or missing. Problem is spring loads both files even if spring.profiles.active=dev and the application is getting the com.example.enableMock property. How do I just load profile specific property file? 回答1: By