Progress deploying Clojure to Google App Engine

I have been struggling for the last couple of days trying to deploy a test Clojure application to Google App Engine, with helpful prods from @perezd. I am using appengine-magic. The HEAD is broken, and the stable 0.5.0 branch has old dependencies. I fixed up some of the breakage in appengine-magic HEAD, coming up with the same solution as this unpulled pull request. Still, that didn’t quite do it. lein appengine-prepare was building a jar which lacked the needed Clojure language dependencies, so when uploaded to App Engine, the app page would just give a 500 error. lein uberjar would build a jar file including those dependencies, so I used that and followed the key steps in appengine_prepare.clj to put the jar in the right place.

Here’s how I finally got it to work:

Add the following to the project.clj file:

:aot [foobar.core, foobar.app_servlet]

Build, prepare and deploy with:

lein compile
lein uberjar
mv target/foobar-0.1.0-SNAPSHOT-standalone.jar war/WEB-INF/lib/ --enable_jar_splitting --oauth2 update war