hot deploy in embedded jetty

前端 未结 1 1785
滥情空心
滥情空心 2020-12-13 15:46

I have a Spring Roo project and I use mvn jetty:run to run my app. The only problem is changes to the *.java classes do not hot deploy, while chang

1条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-13 16:29

    You need to set the scanIntervalSeconds to a value greater than 0 to enable it:

    scanIntervalSeconds - The interval in seconds to scan the webapp for changes and restart the context if necessary. Ignored if reload is enabled. Disabled by default. Default value is: 0.

    So the configuration might looks like this:

    
      org.mortbay.jetty
      maven-jetty-plugin
      6.1.22
      
        1
      
    
    

    Once enabled, the jetty maven plugin will scan the directory defined in classDirecory (which points to ${project.build.outputDirectory} by default i.e. target/classes) for changes.

    You then just need to have your IDE compile classes in target/classes (or to run mvn compile) and Jetty will restart the context upon changes on Java classes.

    0 讨论(0)
提交回复
热议问题