How to support (gasp!) WAR file deployment

Hi All!

I have a gig that requires I deploy a Java application to Wildfly. They aren’t hung up about what JVM language I use, and of course I prefer to use Clojure; however, with the deprecation of Immutant I’m not finding any current options for building WAR files for deployment to a Wildfly cluster.

Any pointers how to achieve this, ideally using deps, appreciated. It’s been a very long while since I had to target a J2EE container as an actual job requirement - like as in, Rich Hickey was inventing Clojure around that time. I do NOT want to write this in plain ol’ Java if I can help it, so … thanks in advance for any pointers!

  • bc

And yes I am reviewing Immutant code for clues about forking and just using it despite its deprecation (after maybe updating it to more modern versions of Wildfly and its dependencies, if the LOE isn’t too horrible).

But if anyone knows a “one weird trick” to build WAR files short of that, I’d be grateful.

  • bc

.war files are just pretty much “uberjar” .jar files with an extra /WEB-INF/web.xml in them.

What that file looks like I do not remember, but they just do some mappings from things to Java classnames. You can use CLJ :gen-class to generate those.

Shouldn’t be much to it, but I haven’t done a .war file in 15+ years, so I might be misremembering.

Ah well, I google’d it and I guess misremembered. Pretty close though.

tools.build tasks should be able to do all of that.

In case you are using Leiningen, take a look if the GitHub - kumarshantanu/lein-servlet: A Leiningen 2 plugin to work with servlet-based webapps plugin can help. It has been quite a while since it was last updated, but it may still work.

I suppose I would need to write an adapter for JBoss/Wildfly to make that work, besides updating it for the last decade of “progress” in the J2EE world. Which as far as I can tell has been mainly centered around updates to the JVM and related libraries. Many of which no longer exist/are deprecated/have been replaced. The pain vs gain ratio on this one feels quite high. Lol. But I want to use Clojure!

– bc

I don’t mind trying to add support for JBoss/Wildfly in my Undertow libraries undertow and ring-undertow.