David Welch
David Welch

Reputation: 1991

Best way to develop with Spring Boot + IntelliJ

We've got a product that is built on top of Spring Boot and deployed via an executable war via embedded Tomcat, but during development we've adopted the approach of developing on a hosted Tomcat so our IDEs (IntelliJ mostly) will have hot-swap / redeploy support (rather than cycling our entire app, which takes a while to boot).

We recently added spring-boot-starter-websocket to our project & have run into issues with the hosted Tomcat's classloader using the embedded Tomcat's resources and crapping out. We can get around it by using profiles and marking the embedded libs as provided so that only our CI builds include them, but it's error prone & hacky at best.


So, my question is this: is there a better way of doing things? Using the Maven plugin or the runnable class introduces problems, as the maven plugin won't hotswap and the runnable class has issues finding classpath things like JSPs (wish we had switched to Thymeleaf beforehand, but next time ;)

The requirements for a "better" development cycle would be:

  1. Code hotswap - aka not having to restart the app / server while developing (outside of making changes to method signatures & whatnot)

  2. Good tooling support

  3. Easy, repeatable setup -- pretty much "checkout and run"

Thanks!

Upvotes: 1

Views: 2417

Answers (1)

Patrick Cornelissen
Patrick Cornelissen

Reputation: 7958

You don't need tomcat for class reloading anymore. With Spring-boot 1.2 you can just debug the maven target spring-boot:run and have class reloading. This works for me in intellij.

Upvotes: 1

Related Questions