问题描述
我最近将grails应用程序升级到2.4.3,并且在此过程中将资源插件升级到1.2.14.我意识到资产插件目前是首选,但是我暂时还不能进行切换.我在ApplicationResources.groovy
I've recently upgraded a grails app to 2.4.3 and in the process upgraded the resources plugin to 1.2.14. I realize the assets plugin is preferred at this point, but I cannot make the switch just yet. I have the following defined in my ApplicationResources.groovy
modules = {
core {
resource url: '/js/main.js', disposition: 'head'
resource url: '/lib/bootstrap/css/bootstrap.css', disposition: 'head'
... more here
}
}
运行该应用程序时,我得到以下信息:
When I run the app, I get the following:
| Error 2015-02-01 23:13:40,005 [localhost-startStop-1] ERROR resource.ResourceMeta - Resource not found: /lib/bootstrap/css/bootstrap.css
如果查看我所附的图像,您会发现该文件确实在正确的位置,并且可以与旧版资源插件一起使用.
If you look at the image I've attached, you can see that this file is indeed in the correct place, and this worked with an older version of the resources plugin.
推荐答案
Grails Resources插件使用Config.groovy
中的grails.resources.adhoc.patterns
和grails.resources.adhoc.includes
值来确定要处理的资源.也许这种行为在各个版本之间都发生了变化,您需要像这样添加lib目录:
The Grails Resources plugin uses the grails.resources.adhoc.patterns
and grails.resources.adhoc.includes
values in Config.groovy
to determine which resources to process. Perhaps this behavior changed across versions and you need to add the lib directory like so:
grails.resources.adhoc.patterns = ['/images/*', '/css/*', '/js/*', '/plugins/*', '/lib/bootstrap/css/*']
grails.resources.adhoc.includes = ['/images/**', '/css/**', '/js/**', '/plugins/**', '/lib/bootstrap/css/**']
这篇关于升级后Grails资源插件找不到/lib/文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!