I am developing GWT application in Eclipse in Hosted mode.
When I change something in CSS I cant see it in browser. I am trying full reload in browser using CTRL+F5, restarting my App in Eclipse and no change.
Only thing which helps is rebuild my app using maven clean install, restart App in Eclipse and then i can see changes. This takes a lot of time.
Any idea what I am doing wrong? I think there must be better way.
regards,Lukas
The problem is that in dev mode the src webapp folder copied to target only at startup, and DevMode does not refresh it. As a workaround you can use copy-resources, that take care of applying changes on the fly.
<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>
I use an external CSS file for my app, and I immediately see all changes in my browser upon simple refresh (no emptying cache, server restart, etc.) in both Chrome and Firefox.
The problem may be related to the location of your file. My file is in the /war directory, and I edit it directly. Another possibility is how you reference your file in your host page. Make sure you have a relative path like "/myCss.css".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With