How to run SparkJava / Maven java class locally

While we develop our applications using package manager such as Maven, we often need to run applications locally to test our changes.

Our desirable destination is hot deployment of java classes without recompiling. JRabel is just an afterthought! It is not a permanent solution.

Until we reach such in-built feature in Java, we have to live with edit-compile-run cycle for local developmental needs.

This is how you can run many Java frameworks which includes embedded app servers like as Jetty.

Add following plugin to your pom.xml under <plugins></plugins>


Please replace com.todoapp.Bootstrap with your application main class or bootstrap class.

Now run following commands:

mvn compile exec:java  

Don't forget to include compile goal before 'exec:java'