简体   繁体   English

如何使用外部classpath文件夹运行spring boot jar

[英]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脚本文件);

project structure in eclipes: 日蚀的项目结构:

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.

相关问题 spring-boot-maven-plugin创建的jar通过使用classpath运行 - spring-boot-maven-plugin created jar run by using classpath 如何在类路径 Spring 引导 Jar 中添加 Ojdbc jar? - How to add Ojdbc jar in classpath Spring Boot Jar? 带有类路径的 Spring Boot 可执行 Jar - Spring Boot Executable Jar with Classpath 如何在类路径上运行带有额外文件的Spring Boot应用程序而不修改应用程序(xxx.jar) - how to run Spring Boot application with an extra file on classpath without modifying the application (the xxx.jar) 在类路径中启动 spring 中的访问文件夹 - access folder in spring boot in classpath 在运行时从 spring 引导中的外部文件夹加载 jar 文件 - Loading jar file at runtime from an external folder in spring boot 将外部文件夹添加到可运行 jar 中的 ClassPath - Adding a External Folder to the ClassPath in a runnable jar 如何从 Spring Boot 应用程序的文件夹作为 jar 运行主应用程序(不是 Spring Boots 应用程序) - How to run a main application (not a spring boots appl) from a folder of Spring Boot application as jar Spring Boot Jar中的类路径扫描不起作用 - Classpath Scanning in Spring Boot Jar Not Working 在 Spring 启动(Maven)中运行时未找到外部 jar class - External jar class not found while run time in Spring boot (Maven)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM