빌드 관리로 Gradle을 사용하여 GWT 프로젝트를 설정했는데 모든 것이 정상입니다.
Eclipse에서 로컬 Tomcat에 프로젝트를 배포 할 수 있으며 응용 프로그램이 의도 한대로 실행됩니다. 그러나 DevMode를 시작하고 CSS 리소스 (@Source 주석이있는 CssResource 클래스로 바인딩되어 있음)에서 뭔가를 변경하면 GWT DevMode가 catch하지 않고 CSS 변경 사항도 고려되지 않습니다. 내가 빠진 것이 있습니까? 나는 DevMode가 gwt 컴파일을 다시하지 않고도 개발 중에 .css 파일의 변화를 감지 할 것으로 기대한다. 여기 GWT DevMode가 CSS 파일의 변경 내용을 다시로드하지 않습니다.
public interface XOFooterPanelResource extends FooterPanelResource, ClientBundle {
@Override
@Source("XOFooterPanel.css")
XOFooterPanelStyle style();
@Override
@ImageOptions(repeatStyle = RepeatStyle.Horizontal)
ImageResource footerPanelBackground();
@Override
@ImageOptions(repeatStyle = RepeatStyle.Horizontal)
ImageResource footerPanelBackgroundEndUser();
@Override
@Source("footerDelimiter.jpg")
ImageResource footerDelimiter();
}
public interface XOFooterPanelStyle extends FooterPanelStyle, CssResource {
}
당신은 내가 CssResource를 확장 내 XOFooterPanelStyle 인터페이스가 볼 수 있듯이. 이는 CSSF 파일의 이름과 함께 @Source 주석을 사용하여 ClientBundle을 확장하는 XOFooterPanelResource에서 사용됩니다.
그리고 여기가 DevMode를 시작 책임이 있습니다 내 Gradle을 빌드 파일의 일부입니다
내가 응용 프로그램을 실행하는 데 이클립스 내에서 바람둥이를 사용하고 전에-noserver
옵션이 설정되어 있으므로, 언급 한 바와 같이
javaexec {
main = 'com.google.gwt.dev.DevMode'
jvmArgs = ['-Xmx2048M', '-XX:MaxPermSize=1024M']
classpath {
[
sourceSets.main.java.srcDirs,
// Java source
sourceSets.main.output.resourcesDir,
// Generated resources
sourceSets.main.output.classesDir,
// Generated classes
sourceSets.main.compileClasspath // Deps
]
}
args = [
'-startupUrl',
'myapp/index.html',
'-noserver',
'-war',
'build/devmode',
'-gen',
'gen'
]
ext.gwtModules.each {
args += it
}
}
.
조치 방법으로 maven-resources-plugin 복사 리소스를 사용하십시오. src/main/webapp $ {project.build.directory}/gwt-webapp outputDirectory> https://maven.apache.org/plugins/maven-resources-plugin/examples/copy-resources.html –