草庐IT

automationPropertiesFileURL

全部标签

java - Scala jar 读取外部属性文件

我已经编写了一些代码并将其导出为jar文件。在这个jar中有一个名为automation.properties的文件,其中包含我正在加载的默认值valautomationPropertiesFileURL=getClass.getResource("/automation.properties")if(automationPropertiesFileURL!=null){valsource=Source.fromURL(automationPropertiesFileURL)config=newProperties()config.load(source.bufferedReader(