I am migrating a project from gwt 2.6.1 to gwt 2.7.0, The compilation succeeded but it displays stange warning messages during the compilation
[WARN] Resource 'images/home.png' was located via ClassLoader. As a result changes in that resource will not be reflected in per-file recompiles. It should be registered via <source /> or <resource /> entry in your .gwt.xml. In a future version of GWT, we will remove this fallback and your application will stop compiling
I have an interface which extends ClientBundle
public interface HomeResources extends ClientBundle {
@Source("images/home.png")
ImageResource home();
}
and the path of the image file home.png is src/main/resources/images/home.png
It works well with gwt 2.6.1, but according to this warning message it won't compile anymore with the next gwt version 2.8.0.
I tried to add these tags <source /> or <resource /> in my Module.gwt.xml file but it doesn't seem to work, any suggestion to fix this behavior ?
Finally I created the folder src/main/resources/<same_package_ClientBundle>/images and placed the image in this folder, the warning message disappears
In GWT your resources that you wont to use in ClientBundle should be located near the ClientBundle class. For your example:
your resources should be located inside this package: com.somepackage.client.images