问题
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