Skip to content

@ConfigurationProperties does not work on @Bean methods in auto-configuration classes when metadata caching is disabled on the bean factory #18440

Closed
@arnesacnussem

Description

@arnesacnussem

Spring Boot version 2.2.0.M6

change the value of spring.messages.basename in application.properties does not make any difference

demo.zip
In this demo,the test com.example.demo.DemoApplicationTests#contextLoads will always fail.

Make a breakpoint at resolveCodeWithoutArguments:151, org.springframework.context.support.ResourceBundleMessageSource#resolveCodeWithoutArguments

The getBasenameSet() will always return a set which only contain one element: "messages"

But if eval the getResourceBundle("msg", locale) at that point,it will return the correct thing.

Also
org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration.ResourceBundleCondition#getResources returns the correct thing.

Metadata

Metadata

Labels

type: regressionA regression from a previous release

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions