Option 1:
For most real word applications, the properties are not directly packaged with the sources as it can contain sensible info (database password for instance). A simple solution to this, is to put application properties on filesystem and then reference them with the spring.config.location argument
java java -jar demo-0.0.1-SNAPSHOT.jar -Dspring.config.location=/etc/demo/application.properties
this way you keep application.properties away of the packaged jar and you can parse and subsitute values into the application.properties file with your deployment toolchain (like ansible) for each environment accordingly.
some useful doc can be found here: https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html
Option 2:
use profiles. In classpath resources you can have a main application.properties which stores the properties which are common for all environments and then one application-{env}.properties for each environment with specific keys e.g application-dev.properties, application-int.properties, application-prod.properties...
At startup you specify the active profile with then environment variable spring.profiles.active :
java -jar -Dspring.profiles.active=prod demo-0.0.1-SNAPSHOT.jar