You can use variable defined in jenkins in an application.properties so that it is overridden by a value when jenkins starts building the application. Some example of this configuration.
Example application.properties
spring.datasource.url = $ {VARIABLE-JENKINS}