spring boot kotlin idea hotswap (live reload) with handlebars

1. File | Settings | Build, Execution, Deployment | Compiler | Build project automatically (mark it as checked)

2. press CTRL+SHIFT+ALT+/   , Select Registry, and find compiler.automake.allow.when.app.running , (Mark it as checked)

3. restart idea 

4. Add dependency to build.gradle  

dependencies {
    compile("org.springframework.boot:spring-boot-devtools")
   // compile 'pl.allegro.tech.boot:handlebars-spring-boot-starter:0.3.0'
}
bootRun {
    sourceResources sourceSets.main
}

    

5. Add setting to ${project_dir}\src\main\resources\application.yml

handlebars:
  cache: false  # Production env , this must be true

6. Press Shift+F10 run application

7. try edit something, then you will see the auto hotswap and live reload working

 

Reference:

https://docs.spring.io/spring-boot/docs/2.1.0.BUILD-SNAPSHOT/gradle-plugin/reference/html/#running-your-application-reloading-resources

https://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-devtools.html

http://livereload.com/extensions/

 

Post: 2018-09-22 19:53:18

Views: 1

Follow me: @twitter @github
Scan QR code and Donate me via alipay:
donate me via alipay
Donate me Bitcoin:136MYemy5QmmBPLBLr1GHZfkES7CsoG4Qh
Powered by GoSense RSS