What is the syntax of Spring Boot "application.properties" file?

2.1k views Asked by At

I've seen different delimeters for properties : = Can't find reference about it.

1

There are 1 answers

0
glytching On BEST ANSWER

In application.properties you can specify properties in either of these forms:

  • Using =:

    key=value

  • Using :

    key: value

All examples in the Spring docs for application.properties use = as the delimiter. But Java properties also supports : so by extension Spring (which is utilising java.util.Properties under the hood also supports :. Here's the relevant extract from the java.util.Properties Javadoc ...

The key contains all of the characters in the line starting with the first non-white space character and up to, but not including, the first unescaped '=', ':', or white space character other than a line terminator.