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被调用。 –