我目前正在使用Jetty插件进行gradle开发:
apply plugin: 'war'
apply plugin: 'jetty'
...
jettyRunWar {
httpPort = 8080
reload = 'automatic'
scanIntervalSeconds = 2
daemon = false
}
jettyRun {
httpPort = 8080
reload = 'automatic'
scanIntervalSeconds = 2
daemon = false
}
但是,热部署无法按预期工作。使用gradle jettyRunWar
时,插件似乎在使用gradle war
时重新加载上下文,但实际上没有任何变化。使用gradle jettyRun
时,重新加载有效,但JSF不再有效:
Could not instantiate listener com.sun.faces.config.ConfigureListener: java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener
AnnotationConfigurator does not found classes for annotations in /WEB-INF/classes/ . This could happen because maven jetty plugin is used (goal jetty:run). Try configure org.apache
.myfaces.annotation.SCAN_PACKAGES init parameter or use jetty:run-exploded instead.
任何想法如何让这些选项之一工作?设置上述参数会导致更多例外情况。