File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Clojure and the fly likes Packaging/Deploying Web App Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Languages » Clojure
Bookmark "Packaging/Deploying Web App" Watch "Packaging/Deploying Web App" New topic
Author

Packaging/Deploying Web App

Ari King
Greenhorn

Joined: Apr 22, 2010
Posts: 20
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

    Joined: Feb 09, 2011
    Posts: 259
        
        5

    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

    Joined: Apr 22, 2010
    Posts: 20
    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

    Joined: Feb 09, 2011
    Posts: 259
        
        5

    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

    Joined: Apr 22, 2010
    Posts: 20
    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

    Joined: Feb 09, 2011
    Posts: 259
        
        5

    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!
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Packaging/Deploying Web App