访问Gradle/Spring/javax中的外部消息源文件

访问Gradle/Spring/javax中的外部消息源文件,java,spring,gradle,Java,Spring,Gradle,我正在研究一个带有多个模块的gradle解决方案。我一直在努力将邮件覆盖移动到一个(次要)messages.properties文件,其中包括以下行的条目: validation.account.required=Please enter your account 对于像这样的查找 @NotNull(message="{validation.account.required}") private Long account; 应用程序使用引导,因此验证属性文件连接在application.cl

我正在研究一个带有多个模块的gradle解决方案。我一直在努力将邮件覆盖移动到一个(次要)messages.properties文件,其中包括以下行的条目:

validation.account.required=Please enter your account
对于像这样的查找

@NotNull(message="{validation.account.required}")
private Long account;
应用程序使用引导,因此验证属性文件连接在application.class中

@Bean
public MessageSource messageSource() {
    ResourceBundleMessageSource messages_validations = new ResourceBundleMessageSource();
    messageSource.setBasename("messages_additional");
    return messageSource;
}
这一切都很好。但是,我希望所有模块(数据服务、应用程序服务、实用程序jar等)都指向同一个外部文件。在配置中是否有标准的方法来实现这一点,或者我是否需要编写某种类型的类装入器bean