SpringBoot unknown property in application.properties

I use this method to add properties in the file application.properties.

Add your new property in application.properties : [email protected] Hover the new property, you'll see a "quickfixes tooltip" which proposes you to add the new property: Create metadata for 'default.to.address'.

Then, browse the class and field you want to bind the property to and add this annotation:

@Value("${default.to.address}")
private String address;

Now your object field should be valued with the property value.


I was also having the same warnings in application.properties and looking for a way to get rid of this. Searching for an answer has led me here. So I am posting my answer; it may be useful.

There is no harm in using your custom properties in application.properties. There are two ways to get rid of this -

  1. As mentioned in one of the answers, you can add the meta-data for the custom properties (manually or using quick-fix in STS).

  2. If you don't want to add meta-data, then in STS, go to Window -> preferences -> spring -> boot -> properties editor. Here, select 'unknown property' as ignore. By default, it is warning.


It's because it's being opened by the STS properties editor which validates properties amongst other things. There's no harm in having it in the application.properties file, you can even add your own meta-data for the property.

http://docs.spring.io/spring-boot/docs/current/reference/html/configuration-metadata.html