lein-ring or leiningen-war?

Skip to first unread message

Shantanu Kumar

May 28, 2011, 3:30:37 PM5/28/11
to Clojure Web Development

I want to understand which the canonical way to build WAR files --
lein-ring or leiningen-war plugin? I find lein-ring more interesting
for the reason that it also lets me run the app directly from the
command line. Does leiningen-war offer something extra that I am


James Reeves

May 28, 2011, 3:39:22 PM5/28/11
to clojure...@googlegroups.com

The leiningen-war plugin is more low-level. You have more control over
how the war is generated, but you have to do more work. You have to
manually create a web.xml file, and create a namespace that can be
gen-classed into a HttpServlet.

The lein-ring plugin is considerably easier to use, but at the cost of
being less flexible. The web.xml and servlet are generated
automatically - all you have to do is add a reference to your handler
function to your project.clj.

If you don't need to manually generate a complex web.xml file, then
you're probably best sticking with the lein-ring plugin.

- James

Reply all
Reply to author
0 new messages