spring boot hotswap with Intellij IDE

后端 未结 7 2095
长发绾君心
长发绾君心 2020-11-28 02:40

I have a spring boot application running fine with Intellij IDE. i.e i started the Application class that has the main method which delegates to SpringApplication.run. Every

7条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-28 03:06

    You can use either of the following methods to auto reload Thymeleaf templates:

    1. Spring Boot Dev Tools
    2. Change Thymeleaf Templates Path
    3. Gulp Watch

    I recommend Gulp watch as it is easier to setup and works great:

    var gulp = require('gulp'), 
    watch = require('gulp-watch');
    
    gulp.task('watch', function () {
        return watch('src/main/resources/**/*.*', () => {
                gulp.src('src/main/resources/**')
                    //replace with build/resources/main/ for netBeans
                    .pipe(gulp.dest('out/production/resources/')); 
        });
    });
    
    gulp.task('default', ['watch']);
    

    Now enter the following command in your terminal to start gulp watch:

    $ gulp 
    //OR
    $ gulp watch
    

    I wrote a blog post on auto reloading Thymeleaf templates without restart in IntelliJ IDE.

提交回复
热议问题