I check the source Spring autoconfigure org.springframework.boot.autoconfigure.contextMessageSourceAutoConfiguration I look like spring.messages.basename cannot config with a path outside of file jar or how to config to can use Spring autoconfigure In the source framework return new PathMatchingResourcePatternResolver(classLoader) .getResources("classpath*:" + target + ".properties");

Can help me explain why adding "classpath*:" does not allow the use of a path the jar file outside? Cuzz, I want setup folder i18n folder not in Jar to can update message when restart app or cache spring.messages.cache-seconds SpringBoot How  spring.messages.basename config path file jar outsite, to easy edit message no rebuild source

Comment From: wilkinsona

When you launch an application with java -jar (I assume that's what you're doing), you cannot specify additional classpath locations. In other words, you cannot use both -jar and -cp at the same time. This is a limitation of the JVM.

You may be able to achieve your goal by launching your application differently. Something like this:

java -cp application.jar:another/location org.springframework.boot.loader.launch.JarLauncher

If you have any further questions, please follow up on Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.

Comment From: nguyentthai96

An idea: load jar java -cp application.jar:another/location org.springframework.boot.loader.launch.JarLauncher; but it's me want configuration "spring.messages.basename" can special path file jar outsite; as load default application.properties in the folder ./config same path file boot jar.

I think didn't need classpath in ".getResources("classpath:" + target + ".properties");" so I would like to organize folder storage struct message.properties outsite change config text easy no rebuild source code.

Comment From: wilkinsona

Unfortunately, that isn't how the JDK's ResourceBundle works. Please see its getBundle method and the description of how it uses ClassLoader.getResource() for details.

As I said above, please follow up on Stack Overflow if you have any further questions.