Working on a web application with SpringBoot and want your changes made in IntelliJ IDEA to be visible in the browser right away? Then this is for you:
Security Hint
Before you install the following plugins to your browser, be aware that these could spy on your browser activity. To mitigate risk, I suggest that you use separate operating system account/profile for critical and non-critical tasks and only install such plugins in the browsers of the non-critical account/profile.Installing the LiveReview plugin in Firefox
- Open the Plugin Settings Page of your Firefox browser.
- Type "livereload" in the search field in the top right area.
- Select and install the plugin "LiveReload 20.2.1" (*) - see screenshot.
It's the Web extension based version of LiveReload. Supports Firefox 57 (Firefox Quantum) by Todd Wolfson. - Activate the plugin.
Now you see an icon which looks like a circle made of two arrows around a small circle in your Firefox toolbar - see screenshot. - To activate the live reload functionality, click the icon to connect.
It should turn from black to blue when connected, but if not, also hover with your mouse pointer over the icon to see it's status.
Installing the LiveRewiew plugin in Google Chrome
- Open the Google Chrome WebStore with your Chrome browser.
- Type "lifereload" in the search field on the top left.
- Add the plugin "LiveReaload" supplied by livereload.com - see screenshot.
- To activate the live reload functionality, click the icon to connect.
In my Chrome browser it does not turn blue when connected, but one can also hover with the mouse pointer over the icon to see it's status.
Add the spring-boot-devtools Dependency
For Maven, add this dependency to your pom.xml (given the parent-pom is effectively spring-boot-starter-parent with proper version number).
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime
</dependency>
For Gradle, also given you have a spring-boot-starter configuration, add the dependency like this:
dependencies {
compile("org.springframework.boot:spring-boot-devtools")
}
In either case re-import your dependency config into IntelliJ IDEA (if auto-import is not activated anyway).
Twitter
Facebook
Reddit
LinkedIn
StumbleUpon
Email