Clojure Uberjar not loading resource file

后端 未结 2 1907
予麋鹿
予麋鹿 2021-01-12 07:23

I use lein uberjar to create a standalone jar of an application.

When executing

java -jar dataloader-0.1.0-SNAPSHOT-standalone.jar,
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-12 07:47

    If you want to read the content of the configuration.json file, do not call io/file. Instead, use slurp function, like that:

    (def config (slurp (io/resource "configuration.json")))
    

提交回复
热议问题