Developing with Wildfly Swarm in IDE without restarts - "hot deploy" somewhere?

Viewed 5656

I'm interested in the Wildfly Swarm project to create fat-jar JavaEE application but can't figure out how to "hot deploy" changed classes from the IDE.

Whenever I change a line of code or a JSF xhtml file I currently have to restart the whole application which takes 7s or so. That's not very productive.

Spring Boot offers a spring-boot-devtools that reloads at least some classes, traditional app servers offer hot-deploy protocols. Is there anything similar for Wildfly Swarm? Would JRebel help here?

4 Answers

My solution was to use IntelliJ IDEA and create an exploded WAR artifact from my sources. Don't include any of the WildFly Swarm dependencies, but do include everything else.

Then you can use regular old WildFly Standalone with the JBoss run configuration, and IntelliJ will deploy the exploded war. From there you can hot swap, debug, etc.

For development, run your code on WildFly Standalone. For production, use the WildFly Swarm jar. This works perfectly for me, and I've been using this method for months without many problems.

I know it's a bit late but when using IntelliJ IDEA we are using the org.wildfly.swarm.Swarm class, which can be started from the IDE and it gives you the ability to hot reload classes in Debug mode. You can make a run config with that, make sure you set the Working directory and the Use classpath of module configs.

Related