0
我使用spring引導1.4創建了一個可執行jar,並使用嵌入式tomcat。 我們在bat文件中有一些腳本,我們需要在啓動tomcat之前運行bat文件。在啓動spring引導之前啓動腳本嵌入式tomcat
在此先感謝
我使用spring引導1.4創建了一個可執行jar,並使用嵌入式tomcat。 我們在bat文件中有一些腳本,我們需要在啓動tomcat之前運行bat文件。在啓動spring引導之前啓動腳本嵌入式tomcat
在此先感謝
您可以在命令行運行程序接口上執行腳本。
public class Application implements CommandLineRunner{
public static void main(String[] args) throws Exception {
SpringApplication.run(Application.class, args);
}
@Override
public void run(String... strings) throws Exception {
// Call the batch script here
}
}
這看起來像一個有效的答案,但我會想驗證的Tomcat啓動時,你的問題明確表示,你需要的腳本,它開始前執行前的CommandLineRunner被調用。 –