Reading resource file inside jar dependency

前端 未结 2 1250
北恋
北恋 2021-01-21 22:16

Before I explain my problem - I\'ve tried to find solution in already asked questions, but none of them worked ;)

I\'m trying to read file inside jar, which is a depende

2条回答
  •  无人及你
    2021-01-21 23:22

    Use target jar classloader like this

    ClassInOtherJar.class.getClassLoader().getResourceAsStream("filename.xml") 
    

提交回复
热议问题