所以我有我的 spring bott 应用程序:
@Configuration
@PropertySource("${configuration.file}")
public class Application extends SpringBootServletInitializer implements CommandLineRunner {
...
public static void main(String[] args) throws IOException {
SpringApplication app = new SpringApplication(Application.class);
System.setProperty("configuration.file","file:"+"path to my file");
app.run(args);
}
...
当我在 windows configuration.file 上运行我的应用程序时,文件设置正确但是当我在 tomcat 服务器上运行它时,我得到:
Could not resolve placeholder 'configuration.file' in string value "${configuration.file}"
问题的原因可能是什么?