<分区>
到目前为止,我能够通过 ClassLoader 加载属性文件,因为它是一个独立的应用程序 -> jar
/**
* Path and filename for {@code.properties}.
*/
private String propertiesFileName = "./com/config/resources/config.properties";
propertiesFromFile.load(ClassLoader.getResourceAsStream(propertiesFileName));
现在我需要在 Web 应用程序中使用这个 jar,问题是通过 ClassLoader 我得到 NULL
如何使 jar 内部能够读取属性文件?
我为什么要通过 maven ?
请指教
谢谢