3 ms·
This is a little silly. I haven't played with Compojure, but Maven, and all this save-file-to-reload stuff is completely unnecessary with the Clojure and Jetty
by gcv 17y ago
This is a little silly. I haven't played with Compojure, but Maven, and all this save-file-to-reload stuff is completely unnecessary with the Clojure and Jetty combination.
Clojure is a Lisp, and like any decent Lisp, gives you full access to the compiler at runtime. This means that, if you wire your app to Jetty correctly — remember that Jetty can run embedded in your app, rather than making your app run inside its container — you can just recompile whichever functions you modified and see the application change on the fly. No XML, no scanner intervals, and no additional complexity. I don't know about Enclojure (Eclipse) or La Clojure (IntelliJ IDEA), but with Emacs and SLIME, it's just a matter of hitting C-c C-c to recompile the current function.
- cemerick 17y agoI'd agree with you if I were just building a weekend project in my free time using only clojure and jetty. However, we're building things with an eye towards deploying in a standard Java container (e.g. war packaging), so there's more moving pieces than just clojure and jetty. FWIW, I can do what you describe using enclojure (which is a netbeans plugin, not eclipse BTW) when I want to as well.
- gcv 17y agoI've dealt with deploying Java apps in-container, as .war files, and it has invariably been painful. Deployment to a new server requires installing the container first. Then configuring it, an excruciating process of editing many XML files. Configuration management for production, staging, QA, and development environments almost immediately becomes a whole separate set of fragile programs and scripts. I have found it much easier to treat the main app as just a piece of software that happens to interact with the rest of the world using HTTP. Deployment becomes trivial; it really just needs a startup script and a directory of .jar files (dependency libraries) and another .jar or directory of .class files for your actual application. Installing on a new server doesn't require much more than a pre-installed JVM. Out of curiosity, what value does deploying in a container add for you?
- cemerick 17y agoIn no way am I trying to be enterprisey (although if we do end up selling this software to some customers, it'll be very nice to be able to say "here's a standard .war"). My aim is to make it as simple and easy as possible to enable continuous deployment across multiple nodes. In that context, the (re)deployment facilities provided by any container beats coordinating things on the command line.
- papaf 17y agoThe clojure maven plugin allows you to set up a swank session that you can interact with using emacs. This is the type of web development that you mention and was a revelation for me when I tried it 2 weeks ago -- especially combined with Firefox autorefresh. Theres nothing to stop somebody from using swank for development and then switching to a web.xml and war file for deployment. Also it seems that in the clojure community, maven has a competitor: http://github.com/technomancy/leiningen http://github.com/technomancy/leiningen
- DTrejo 17y agoThank you for mentioning firefox autorefresh! I knew I needed something like that. You just made my life better.