Skip to content

MessageSourceAutoConfiguration does not consider @PropertySources #1075

@klu2

Description

@klu2

I have a testcase that uses

@PropertySource(value = "classpath:test.properties")

In this file I have:

spring.messages.basename=messages-base

And in message-base_en.properties I have some message keys that are used in the unit test, but the values cannot be found

I extracted all the required code into an own github repository: https://github.com/klu2/spring-boot-issues/

This is the test case:
https://github.com/klu2/spring-boot-issues/blob/master/autoconfigure/src/test/java/net/klu2/springboot/autoconfigure/MessageSourceAutoConfigurationTest.java

This testcase passes with spring boot 1.0.2, but it fails with spring boot 1.1.0 (you can easily check that by exchanging ext.springBootVersion in build.gradle

Most probably this commit is responsible for this issue: 0def764 (#1019)

It works fine, if the messages are in message.properties, but not in message-base.properties. It seems that @propertysource is not considered in the MessageSourceAutoConfiguration

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions