Skip to content

@Value("${someProperty}") should work without having to specify a PropertySourcesPlaceholderConfigurer bean. [SPR-11773] #16395

Closed
@spring-projects-issues

Description

@spring-projects-issues

Adam Berlin opened SPR-11773 and commented

This came up while discussing the injection of YAML configuration using @Value in Spring Boot. (spring-projects/spring-boot#821) The configuration file is loaded by spring-boot, but it is not accessible to @Value until:

@Bean
public PropertySourcesPlaceholderConfigurer configurer() {
    return new PropertySourcesPlaceholderConfigurer();
}

This seems like unnecessary busy-work when setting up my application. Who knows what a PropertySourcesPlaceholderConfigurer is? That should be something the framework sets up for me automatically.


Issue Links:

2 votes, 4 watchers

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: bulk-closedAn outdated, unresolved issue that's closed in bulk as part of a cleaning process

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions