application.properties Tip Can not resolve configurati

Description of the problem

application.properties file in the Spring Boot IDEA project, suggesting that if the custom attributes as follows:

Cannot resolve configuration property 'xxxx'

Here Insert Picture Description

2 a solution

In fact, this is a warning, you can ignore, normal operation,

@Value("${}")

Can get to normal values, the most violent method is to close this examination:
Here Insert Picture Description
to enter the settings Editor -> Inspection -> Spring - > Spring Boot -> Spring Boot application properties, remove the right of the check.

3 solution two (recommended)

Here Insert Picture Description
Here tips Defind Configuration key a, then press Alt + Shift + Enter, it will create an addtional-spring-configuration-metadata.json file:
Here Insert Picture Description
Here name is specified attribute name, type is the type, you can specify a default value plus defaultValue :
Here Insert Picture Description
so there is not warned:
Here Insert Picture Description

Guess you like

Origin blog.51cto.com/14415843/2482881