我正在 Eclipse 中以托管模式开发 GWT 应用程序。
当我在 CSS 中更改某些内容时,我无法在浏览器中看到它。我正在尝试使用 CTRL+F5 在浏览器中完全重新加载,在 Eclipse 中重新启动我的应用程序并且没有任何变化。
唯一有帮助的是使用 Maven clean install 重建我的应用程序,在 Eclipse 中重新启动应用程序,然后我可以看到更改。这需要很多时间。
知道我做错了什么吗?我认为一定有更好的方法。
问候,卢卡斯
最佳答案
问题是在开发模式下,src webapp 文件夹仅在启动时复制到目标,并且 DevMode 不会刷新它。作为解决方法,您可以使用 copy-resources ,负责即时应用更改。
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/gwt-webapp</outputDirectory>
<resources>
<resource>
<directory>src/main/webapp</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
关于css - GWT + Eclipse——如何刷新CSS等静态资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11969931/