So you’ve spent a day or two carefully migrating your Grails 2.4.4 application to Grails 4.0.2. Yet you find that the files in
src/main/webapp aren’t accessible from your views. Annoying right!
I’m sure this is documented somewhere, but I’m damned if I could find it again. The solution is to add a reference to them in your
grails: resources: pattern: /**
Update: After further reading I find this (in section 3.3.2, Step 7):
If you have static assets in your
web-appdirectory of your Grails 2.x application such as HTML files, TLDs etc. these need to be moved. For public assets such as static HTML pages and so on these should go in
TLD descriptors and non public assets should go in
As noted earlier,http://docs.grails.org/3.2.3/guide/single.html#upgrading2x
src/main/webappfolder can also be used for this purpose but it is not recommended.
I have now updated my project and moved everything from
grails-app/assets folders. I’ve also replaced all instances of the