在启动spring boot嵌入式tomcat之前启动脚本

时间:2016-08-13 19:39:56

标签: spring spring-boot

我使用spring boot 1.4创建了一个可执行jar,并使用了嵌入式tomcat。 我们在bat文件中有一些脚本,我们需要在启动tomcat之前运行该bat文件。

提前致谢

1 个答案:

答案 0 :(得分: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
        }
    }