Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 403
Ekaterina Avatar asked Sep 04 '17 13:09

Ekaterina


1 Answers

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.

like image 160
glytching Avatar answered Oct 19 '22 06:10

glytching