I have a spring boot application jar
@SpringBootApplication
@EnableScheduling
@PropertySource({"classpath:1.properties","classpath:2.properties"})
public class MyClass {
//My class
}
1.properties閱讀內部和外部的屬性文件在src /主/資源 2.properties是服務器位置項目位置使用Spring啓動
| MyClass.jar
| config
| 2.properties
但我越來越找不到文件爲2.properties啓動應用程序。請讓我知道我可能會錯過這裏。
如果你的'2.properties'文件在jar之外,那麼你不會在類路徑上找到它 – Catchwa
我已經將它保存在與jar平行的配置文件夾中。所以這個config文件夾也應該在類路徑中可用? – TomJava