• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Packaging/Deploying Web App

 
Ari King
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In my limited experience with Clojure based web apps that are comprised of jetty + ring + compojure I've used the lein-ring plugin to create jars or wars depending on deployment needs. I'm curious to learn:

  • How can I create a deployable jar or war manually (or at least in a less auto-magically way), i.e. without the lein-ring (or lien-war) plugin?
  • How can I create a deployable jar or war -- with or without lein-ring/lein-war -- when the app relies on an alternative adapter such as aleph, http-kit, etc?


  • Thanks.

    -Ari
     
    Sean Corfield
    Ranch Hand
    Posts: 305
    11
    Clojure Linux Mac OS X
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    The standard ways are to use Leiningen with the war, uberwar, jar or uberjar tasks. Leiningen manages your dependencies so it's well placed to create these packages.

    Or am I missing something in your question?
     
    Ari King
    Greenhorn
    Posts: 20
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Sean Corfield wrote:The standard ways are to use Leiningen with the war, uberwar, jar or uberjar tasks. Leiningen manages your dependencies so it's well placed to create these packages.

    Or am I missing something in your question?


    The lein ring plugin generates both the deployment descriptor and a namespace that is "gen-classed" into a HttpServlet; how does one do that using only leiningen? Where does one put the web.xml file in a lein-based clojure web app? What are the requirements of the namespace that will be gen-classed and how is this namespace identified as the entry point of the app in the project.clj? Hopefully, my question is clearer. Thanks.

    Best,
    Ari
     
    Sean Corfield
    Ranch Hand
    Posts: 305
    11
    Clojure Linux Mac OS X
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I saw you'd posted this question on the Clojure mailing list and Phil Hagelberg had responded. I'm mostly using the jetty ring adapter so deployment has not been an issue for me. I guess I don't understand why you don't want to use the standard Clojure tools for this (i.e., Leiningen and the appropriate plugins) so you're best asking follow up questions on the Clojure mailing list - or the Ring mailing list - at this point.
     
    Ari King
    Greenhorn
    Posts: 20
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Sean Corfield wrote:I saw you'd posted this question on the Clojure mailing list and Phil Hagelberg had responded.


    Yes, Phil and Feng were kind enough to share their helpful insights. I posted to this forum as well when it appeared my question in its entirety would not get answered.

    Sean Corfield wrote:I'm mostly using the jetty ring adapter so deployment has not been an issue for me. I guess I don't understand why you don't want to use the standard Clojure tools for this (i.e., Leiningen and the appropriate plugins) so you're best asking follow up questions on the Clojure mailing list - or the Ring mailing list - at this point.


    I believe we have a misunderstanding here. Firstly, I'd prefer to use "standard" clojure tools -- since they're made by knowledgeable clojurians, much like yourself. I essentially am interested in learning how I could package alternative adapter based web apps and how I could customize the package. As per your advice, I'll followup on the clojure and ring lists respectively.

    Lastly, I believe there was also some confusion when you referenced "leiningen war"; I thought you were referencing the now deprecated plugin. Thanks.

    Best,
    Ari
     
    Sean Corfield
    Ranch Hand
    Posts: 305
    11
    Clojure Linux Mac OS X
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Cool. Yeah, you've gone beyond my knowledge of Leiningen plugins at this point. I mostly used Clojure as a dynamically loaded set of libraries for an existing web app, or for standalone programs (command line utilities or Jetty-based web servers, both via lein run).

    It would be nice of you to post your findings back here when you've explored the various options!
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic