how to package resources in a leiningen project

不羁岁月 提交于 2019-12-07 04:56:37

问题


in the sample project,

https://github.com/technomancy/leiningen/blob/master/sample.project.clj

on line 217, there is a directive for including non-code files :

:resource-paths ["src/main/resource"] ; non-code files included in classpath/jar

I have a resources folder in my project and this line in my project.clj

:resource-paths ["resources"] ; non-code files included in classpath/jar

however, when I run lein jar to generate the .jar file, it does not package up the resources folder.

Is there something that I am missing?


回答1:


Actually, it did get packaged. I just was not looking in the right spot:

from: Resources in Clojure applications

'Leiningen borrows the convention for resources from maven, with slightly different folder layouts. The rule states that the resources folder must be used as a compile time classpath root, meaning that leiningen is right in putting all the files inside resources folder in the root location inside the jar.'

I thought that a resources directory would get created with the jar itself but lein jar copied all the files in the resources directory to the root of the jar.



来源:https://stackoverflow.com/questions/12905672/how-to-package-resources-in-a-leiningen-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!