未找到Grails twitter引导插件资源

未找到Grails twitter引导插件资源,grails,grails-plugin,Grails,Grails Plugin,我搜索了stackoverflow,找到了一些类似的参考资料,但没有找到具体的解决方案 我将Grails 2.4.2与twitter引导:3.2.1插件一起使用,但在运行应用程序时出现以下错误: | Error 2014-07-26 11:51:48,592 [localhost-startStop-1] ERROR resource.ResourceMeta - Resource not found: /assets/bootstrap-fixtaglib.css | Error 2014-

我搜索了stackoverflow,找到了一些类似的参考资料,但没有找到具体的解决方案

我将Grails 2.4.2与twitter引导:3.2.1插件一起使用,但在运行应用程序时出现以下错误:

| Error 2014-07-26 11:51:48,592 [localhost-startStop-1] ERROR resource.ResourceMeta  - Resource not found: /assets/bootstrap-fixtaglib.css
| Error 2014-07-26 11:51:48,668 [localhost-startStop-1] ERROR resource.ResourceMeta  - Resource not found: /assets/bootstrap.css
| Error 2014-07-26 11:51:48,725 [localhost-startStop-1] ERROR resource.ResourceMeta  - Resource not found: /assets/bootstrap-theme.css
| Error 2014-07-26 11:51:48,778 [localhost-startStop-1] ERROR resource.ResourceMeta  - Resource not found: /assets/bootstrap-alert.js
| Error 2014-07-26 11:51:48,807 [localhost-startStop-1] ERROR resource.ResourceMeta  - Resource not found: /assets/bootstrap-affix.js
| Error 2014-07-26 11:51:48,837 [localhost-startStop-1] ERROR resource.ResourceMeta  - Resource not found: /assets/bootstrap-dropdown.js
| Error 2014-07-26 11:51:48,860 [localhost-startStop-1] ERROR resource.ResourceMeta  - Resource not found: /assets/bootstrap-modal.js
| Error 2014-07-26 11:51:48,888 [localhost-startStop-1] ERROR resource.ResourceMeta  - Resource not found: /assets/bootstrap-popover.js
| Error 2014-07-26 11:51:48,907 [localhost-startStop-1] ERROR resource.ResourceMeta  - Resource not found: /assets/bootstrap-scrollspy.js
| Error 2014-07-26 11:51:48,921 [localhost-startStop-1] ERROR resource.ResourceMeta  - Resource not found: /assets/bootstrap-tab.js
| Error 2014-07-26 11:51:48,934 [localhost-startStop-1] ERROR resource.ResourceMeta  - Resource not found: /assets/bootstrap-tooltip.js
| Error 2014-07-26 11:51:48,947 [localhost-startStop-1] ERROR resource.ResourceMeta  - Resource not found: /assets/bootstrap-button.js
| Error 2014-07-26 11:51:48,959 [localhost-startStop-1] ERROR resource.ResourceMeta  - Resource not found: /assets/bootstrap-carousel.js
| Error 2014-07-26 11:51:48,977 [localhost-startStop-1] ERROR resource.ResourceMeta  - Resource not found: /assets/bootstrap-collapse.js
| Error 2014-07-26 11:51:48,996 [localhost-startStop-1] ERROR resource.ResourceMeta  - Resource not found: /assets/bootstrap-transition.js
| Error 2014-07-26 11:51:49,012 [localhost-startStop-1] ERROR resource.ResourceMeta  - Resource not found: /assets/bootstrap.less
插件的全部要点是简化资产管道,并让插件将所有内容放在适当的位置

我有BuildConfig.groovy设置来拉入插件:

...
plugins {
    // plugins for the build system only
    build ":tomcat:7.0.54"

    // plugins for the compile step
    compile ":scaffolding:2.1.2"
    //compile ':cache:1.1.7'
    compile ":asset-pipeline:1.8.11"
    compile ":twitter-bootstrap:3.2.1"

    // plugins needed at runtime but not for compilation
    //runtime ":hibernate4:4.3.5.4" // or ":hibernate:3.6.10.16"
    //runtime ":database-migration:1.4.0"
    runtime ":jquery:1.11.1"
    runtime ":resources:1.2.8"

    // Uncomment these to enable additional asset-pipeline capabilities
    //compile ":sass-asset-pipeline:1.7.4"
    compile ":less-asset-pipeline:1.7.0"
    //compile ":coffee-asset-pipeline:1.7.0"
    //compile ":handlebars-asset-pipeline:1.3.0.3"
}
...
据我所知,我的GSP设置正确:

<%@ page contentType="text/html;charset=UTF-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <title>Task Master - Tasks</title>
    <r:require module="jquery"/>
    <r:require module="bootstrap-js"/>
    <r:require module="bootstrap"/>
    <r:layoutResources/>
</head>

<body class="container">

    <h1>Task Master - Tasks</h1>
    <r:layoutResources/>
</body>
</html>

任务主管-任务
任务主管-任务
我检查过,它们不在错误状态下的/assets下。我看到一些人通过手动复制资产入侵了一个解决方案,但是插件有意义吗?要么我错过了一些简单的东西,要么插件中有一个bug。有什么想法吗?谢谢


--Ryan

在Grails2.4中,资产管道是向客户端获取静态资源的默认机制。在BuildConfig中,使用了“资产管道”和“资源”(2.4之前的默认机制)。我不确定,如果这个配置真的是你想要的,如果它甚至工作在所有

只有资产管道的有效配置应为:

BuildConfig.groovy:

plugins {
    compile ":asset-pipeline:1.8.11"
    compile ":twitter-bootstrap:3.2.1"
    runtime ":jquery:1.11.1"
}
grails应用程序/views/layouts/main.gsp:

<%@ page contentType="text/html;charset=UTF-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <title>Task Master - Tasks</title>
    <asset:stylesheet href="application.css"/>
</head>

<body class="container">
    <h1>Task Master - Tasks</h1>
    <asset:javascript src="application.js"/>
</body>
</html>
grals app/assets/javascript/application.js:

//= require jquery
//= require bootstrap
//= require_tree .
有关更多信息,请参阅的文档以及插件的文档

我检查过,它们不在错误状态下的/assets下


这是真的,因为不会在应用程序中复制任何内容,而是资源位于引导插件的内部。资产管道插件扫描每个插件以查找资产文件夹(或出于兼容性目的的web应用文件夹),并将其组合在一起,因此在生成的war中,所有资源都可用。

在Grails 2.4中,资产管道是向客户端获取静态资源的默认机制。在BuildConfig中,使用了“资产管道”和“资源”(2.4之前的默认机制)。我不确定,如果这个配置真的是你想要的,如果它甚至工作在所有

只有资产管道的有效配置应为:

BuildConfig.groovy:

plugins {
    compile ":asset-pipeline:1.8.11"
    compile ":twitter-bootstrap:3.2.1"
    runtime ":jquery:1.11.1"
}
grails应用程序/views/layouts/main.gsp:

<%@ page contentType="text/html;charset=UTF-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <title>Task Master - Tasks</title>
    <asset:stylesheet href="application.css"/>
</head>

<body class="container">
    <h1>Task Master - Tasks</h1>
    <asset:javascript src="application.js"/>
</body>
</html>
grals app/assets/javascript/application.js:

//= require jquery
//= require bootstrap
//= require_tree .
有关更多信息,请参阅的文档以及插件的文档

我检查过,它们不在错误状态下的/assets下


这是真的,因为不会在应用程序中复制任何内容,而是资源位于引导插件的内部。asset pipeline插件扫描每个插件,寻找一个assets文件夹(或出于兼容性目的的web app文件夹),并将其组合在一起,因此在生成的war中,所有资源都可用。

谢谢Mario。今晚我将试一试。我尝试了一下,当我删除“:resources:1.2.8”插件时,错误就消失了。他们在一起似乎有冲突。我想用Bootstrap解决几个问题,以确保一切正常。谢谢。我支持这一点,我删除了buildConfig.groovy中的资源插件,它解决了同样的问题po:s/grals-app/grails-app/gThanks-Mario。今晚我将试一试。我尝试了一下,当我删除“:resources:1.2.8”插件时,错误就消失了。他们在一起似乎有冲突。我想用Bootstrap解决几个问题,以确保一切正常。谢谢。我支持这一点,我删除了buildConfig.groovy中的资源插件,它解决了同样的问题po:s/grals-app/grails-app/g