Running a another task when an uberjar is created with Leiningen

When the uberjar is created, I also need to run lein deps. How do I make Leiningen automatically run lein deps when lein uberjar is run?


lein deps is run automatically on other lein tasks like run jar cljsbuild...

In fact I never use lein deps except in lein do clean, deps .

Note : I am just transitioning to boot myself, but composing tasks is much easier with this build tool.


You can have leiningen run a combination of any lein tasks via the do command. We can then define an alias to run the desired tasks with ease. In your profile.clj include the following:

:aliases {"build-with-deps" ["do" "clean" "deps" "uberjar"]}

Then whenever you call lein build-with-deps it will actually run the following: lein do clean, deps, uberjar .

I recommend reading through the sample project.clj provided by leiningen to better familiarize yourself with the capabilities of aliases.

链接地址: http://www.djcxy.com/p/51746.html

上一篇: 用于分析Haskell程序性能的工具

下一篇: 在Leiningen创建uberjar时运行另一项任务