如何将配置文件传递给scala jar文件 [英] how to pass configuration file to scala jar file

查看:279
本文介绍了如何将配置文件传递给scala jar文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的代码中使用 typesafe config 库,然后生成一个jar文件。当我将reference.conf文件嵌入jar时,应用程序工作正常。但是是否可以提供配置文件作为参数的jar?例如

I am using the typesafe config library in my code and then I generate a jar file. The application works fine when I embed the reference.conf file inside the jar. But is it possible to provide the config file as a parameter to the jar ? for example

java -DmyconfigFile=/dir/dir/reference.conf -jar myjar package.class.myobject.


推荐答案

请参阅此线程,了解如何使用外部akka配置此处

Yes it is. See this thread on using an external akka config here.

java -Dconfig.file=/dir/dir/reference.conf -jar myjar package.class.myobject.

这篇关于如何将配置文件传递给scala jar文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆