2016-08-13 104 views

回答

0

您可以在命令行運行程序接口上執行腳本。

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 
     } 
    } 
+0

這看起來像一個有效的答案,但我會想驗證的Tomcat啓動時,你的問題明確表示,你需要的腳本,它開始前執行前的CommandLineRunner被調用。 –

相關問題