Cannot change CSS in dev mode

730 views
Skip to first unread message

Andrey

unread,
Mar 4, 2011, 8:40:53 AM3/4/11
to Google Web Toolkit
When running GWT app in dev mode static web resources such as css-
files cannot be changed.
To change a line in css I must stop server, change and run again.
That's really inconvenient.

Is there any workaround?

Thanks!

Ben Imp

unread,
Mar 4, 2011, 9:16:49 AM3/4/11
to Google Web Toolkit
I cannot say I've observed the same behavior. The browser may be
caching your CSS, though. Hit refresh a few times and I'd wager you
will see your changes.

-Ben

Brian Reilly

unread,
Mar 4, 2011, 9:24:08 AM3/4/11
to google-we...@googlegroups.com
I have run into this. It may depend on how you start development mode.
I use either maven or IntelliJ IDEA; they may have put some extra
effort into the Eclipse plugin to make it work there, but I'm not
sure.

One workaround that I know of it to use ClientBundle/CssResource. See
http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.html#CssResource.
Doing this also has other advantages, such as minification and
modularization.

-Brian

> --
> You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
> To post to this group, send email to google-we...@googlegroups.com.
> To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
>
>

Andrey

unread,
Mar 4, 2011, 10:24:59 AM3/4/11
to Google Web Toolkit
>> Ben
They are not caching. They are locked by Jetty and eclipse cannot save
the changes ("File is not writeable").

>> Brian
This doesn't concern GWT ClientBundles. It concerns dev mode Jetty
behaviour.
Jetty locks all static resources while running. That's really strange.

Peter Radkov

unread,
Mar 26, 2012, 6:46:05 AM3/26/12
to Google-We...@googlegroups.com
Andrey <minogin@...> writes:


I am observing the same exact behavior. This started happening after I changed
something in my code or css. This happening now for more than 2-3 hours and I
still can't find a solution to it. I've worked with this environment for quite
some time now and I never had this issue before. Reeeeally annoying...

Joseph Lust

unread,
Mar 26, 2012, 1:55:27 PM3/26/12
to google-we...@googlegroups.com
It works fine for me. Just double checked using Eclipse and the WepApp launcher in DevMode. If I change CSS in a CSS file, it appears in Firebug after an F5.

Now, if you are running in DevMode, but not starting services, rather passing the services through to an active Tomcat, then all static files like CSS/Images will come from that server, and DevMode will not update them. I often use ClientBundle/CssResource as Brian suggested since it works regardless of what setting DevMode is running in.


Sincerely,
Jospeh

Kiarash

unread,
Mar 17, 2014, 11:37:23 AM3/17/14
to google-we...@googlegroups.com
Maybe to late for you to answer this but maybe others looking for the answer. This helped me in Intellij 13. In the menu choose
> Run
> Edit Configuration
> Select "Update resources on frame deactivation"

Good luck.

Marc

unread,
Mar 20, 2014, 3:20:38 PM3/20/14
to google-we...@googlegroups.com
Using "mvn gwt:run", you need to place your stylesheet into the source folder. The jetty app seems to ignore the resources folder when looking for updates.

Juan Pablo Gardella

unread,
Mar 20, 2014, 3:34:31 PM3/20/14
to google-we...@googlegroups.com
I can do that with this configuration (maven). I put in bold the important configuration. 

<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<connectors>
<!-- work around file locking on windows -->
<connector implementation="org.eclipse.jetty.server.bio.SocketConnector">
<port>8080</port><!-- this connector defaults to 1300 for some 
reason -->
</connector>
</connectors>
<!-- scanIntervalSeconds>1</scanIntervalSeconds -->
        <webApp> .... </webApp> <contextXml>${basedir}/src/main/webapp/WEB-INF/jetty-context.xml</contextXml> 
</configuration>

jettycontext:

<Configure class="org.eclipse.jetty.webapp.WebAppContext">
     <Call name="setAttribute">
      <Arg>org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern</Arg>
      <Arg>.*/.*foo-api-[^/]\.jar$|./.*bar-[^/]\.jar$|./.*wibble[^/]*\.jar$</Arg>
    </Call>
</Configure>


I can not make it works with jetty 9.x, it works with: <jetty-maven-plugin.version>8.1.10.v20130312</jetty-maven-plugin.version>

I run using mvn jetty:run. The gwt dev mode works with "noserver" argument.

Juan


2014-03-20 16:20 GMT-03:00 Marc <mark...@gmail.com>:
Using "mvn gwt:run", you need to place your stylesheet into the source folder. The jetty app seems to ignore the resources folder when looking for updates.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.

To post to this group, send email to google-we...@googlegroups.com.

Thomas Broyer

unread,
Mar 21, 2014, 11:55:23 AM3/21/14
to google-we...@googlegroups.com


On Thursday, March 20, 2014 8:20:38 PM UTC+1, Marc wrote:
Using "mvn gwt:run", you need to place your stylesheet into the source folder. The jetty app seems to ignore the resources folder when looking for updates.

Run "mvn process-resources" explicitly, or let it be done by your IDE if it can (Eclipse with M2E calls it automatically IIRC)

FYI, the reason is that resources might have filters applied, so you want to read the output, not the input.

Dániel Hári

unread,
Jun 12, 2016, 8:56:10 AM6/12/16
to GWT Users
I found a way as a workaround use maven-resources-plugin copy-resources, this updates on the fly your target with every changes in src webapp.

<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>copy-resources</id>
<!-- here the phase you need -->
<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>

Reply all
Reply to author
Forward
0 new messages