Spring Boot + Jetty和热部署

Ree*_*uuk 2 deployment spring jetty maven spring-boot

我已经阅读了Spring Boot中的热插拔,但没有找到对我的情况有帮助的东西.

我在使用thymeleaf的嵌入式码头服务器上有一个spring-boot应用程序.我的应用程序将提供html,css,js(AngularJS)和REST服务.

文件夹结构是这样的:

/java
   ----
/resources
   /static
       /js
       /css
   /templates (html)
Run Code Online (Sandbox Code Playgroud)

的pom.xml

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
    <exclusions>
        <exclusion>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-jetty</artifactId>
</dependency>
Run Code Online (Sandbox Code Playgroud)

但是当我更改它们时,css/html/js并没有热部署.我每次都要重启服务器.+ bonus =当页面加载时它锁定资源(js)甚至Ant脚本也无法替换它们.

我可以在任何地方设置scanIntervalSeconds吗?

- 编辑 -

Main.java

@Configuration
@ComponentScan
@EnableJpaRepositories
@EnableAutoConfiguration
@Import({RepositoryRestMvcConfiguration.class, PersistenceConfig.class, ThymeleafConfig.class})
public class Main {

   public static void main(String[] args) throws Exception {
       SpringApplication.run(Main.class, args);
   }
}
Run Code Online (Sandbox Code Playgroud)

我通过右键单击类和IDEA中的Debug来运行它.

Dav*_*yer 5

你是如何推出该应用程序的?如果您使用具有调试模式的IDE,它应该可以工作(除了我认为是Windows操作系统的锁定问题),或者如果您使用"mvn spring-boot:run"或"gradle bootRun"启动它.