how to add a hook into the uberjar process (building with lein)

坚强是说给别人听的谎言 提交于 2019-12-10 16:10:39

问题


i would like to add a hook to the uberjar process. the specific example is to download the maxmind geoip dat file into the resources folder so an updated version is bundled into the jar every time it deploys. examples/suggestions appreciated thanks!


回答1:


I recommend making a custom lein task that calls uberjar, rather than using a hook. For example, if your project is called foo:

file: foo/tasks/leiningen/foobuild.clj

(ns leiningen.foobuild
  (:require leiningen.uberjar))

(defn foobuild [project]
  (download-maxmind-geoip-data)
  (leiningen.uberjar/uberjar project))

Then you can run this with:

lein foobuild



来源:https://stackoverflow.com/questions/10644087/how-to-add-a-hook-into-the-uberjar-process-building-with-lein

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