2
我在使用Grails 2.4.4使用jQuery插件时遇到了一些麻烦。这似乎应该是一个简单的设置,但是当我用grails run-app启动我的应用程序时,我看到此消息在Grails 2.4.4中使用jQuery插件的路径问题
|错误2014-12-07 12:38:06,397 [localhost-startStop-1]错误resource.ResourceMeta - 资源未找到:/plugins/jquery-1.11.1/js/jquery/jquery-1.11.1.min.js
在查看文件系统上的“目标”目录时,我在jquery-1.11.1.min.js文件的“plugins”目录下看到一个“jquery-1.11.1”目录,虽然它是位于“webapp”目录中。这里是我的BuildConfig文件的相关部分,任何帮助将不胜感激。
plugins {
// plugins for the build system only
build ":tomcat:7.0.55"
// plugins for the compile step
compile ":scaffolding:2.1.2"
compile ':cache:1.1.8'
compile ":asset-pipeline:1.9.9"
// plugins needed at runtime but not for compilation
runtime ":hibernate4:4.3.6.1" // or ":hibernate:3.6.10.18"
runtime ":database-migration:1.4.0"
runtime ":jquery:1.11.1"
runtime ":resources:1.2.13"
// Uncomment these to enable additional asset-pipeline capabilities
//compile ":sass-asset-pipeline:1.9.0"
//compile ":less-asset-pipeline:1.10.0"
//compile ":coffee-asset-pipeline:1.8.0"
//compile ":handlebars-asset-pipeline:1.3.0.3"
}
您需要选择asset-pipeline和资源之一,并删除其他资源。他们做同样的事情。 – 2014-12-07 22:37:13
嗯......实际上这并没有解决。我确实删除了资产管道并将其他所有内容都保留了下来。我仍然收到错误消息 “资源未找到:/plugins/jquery-1.11.1/js/jquery/jquery-1.11.1.min.js”。任何想法我在这里失踪? – user817851 2014-12-12 04:45:52
这两个插件都会重写文件的名称和/或位置,作为他们所做的工作的一部分。阅读插件文档,了解用于呈现资源的正确URL的taglib的语法 – 2014-12-12 04:51:01