[英]How to Run a spring boot jar with external classpath folder
How to Run a spring boot jar with external classpath folder, 如何使用外部classpath文件夹运行spring boot jar
i have config folder containing .property files. 我有包含.property文件的配置文件夹。 these properties files are required to start the server, how to specify the config folder path while running the jar by java command (basically using .bat script file);
这些属性文件是启动服务器所必需的,如何在通过java命令运行jar时指定配置文件夹路径(基本使用.bat脚本文件);
command line parameters can be accessed as argument in main method. 命令行参数可以在main方法中作为参数访问。 once you access the parameter as per below code you can use it for loading the resources.
一旦按照下面的代码访问参数,就可以使用它加载资源。
public static void main(String[] args) {
String argument=args[0];
SpringApplication.run(ShortUrlApiApplication.class, args);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.