Wro4j 未显示 BootStrap Glyphicons 搜索按钮组件

Wro4j not showing BootStrap Glyphicons search button component

目前我正在为我的 Java 网络应用程序评估网络资源优化器。我开始使用 Wro4j,我遇到了一个小问题,它可能与配置相关。

我遇到的问题仅与 bootstrap 字形组件未正确呈现有关,我在 html 中的代码是:

<p>Search icon on a styled link button:
  <a href="#" class="btn btn-info btn-lg">
    <span class="glyphicon glyphicon-search"></span> Search
  </a>
</p>

我的wro.xml配置

<groups xmlns="http://www.isdc.ro/wro">
    <group name="group1">
        <css>webjar:bootstrap/3.3.2/less/bootstrap.less</css>
        <css>file:${project.basedir}/src/main/wro/main.less</css>
        <css>webjar:bootstrap-select/1.6.3/dist/css/bootstrap-select.css</css>      
        <js>webjar:jquery/2.1.1/jquery.min.js</js>
        <js>webjar:bootstrap-select/1.6.3/js/bootstrap-select.js</js>
        <js>webjar:bootstrap/3.3.2/js/bootstrap.min.js</js>
        <js>webjar:angularjs/1.3.8/angular.min.js</js>
        <js>webjar:angularjs/1.3.8/angular-route.min.js</js>
        <js>webjar:angularjs/1.3.8/angular-cookies.min.js</js>
    </group>
</groups>

这是我在浏览器控制台中得到的错误

我在浏览器的控制台中看到这些错误:

GET localhost:8080/fonts/glyphicons-halflings-regular.woff2 localhost/:1
GET localhost:8080/fonts/glyphicons-halflings-regular.woff localhost/:1
GET localhost:8080/fonts/glyphicons-halflings-regular.ttf 404 (Not Found)

移动我的网络应用程序目录中的字体文件夹解决了这个问题。只需复制字体文件夹下的文件并将其粘贴到您的网络应用 css 目录中。

字体资源在bootstrapless文件中相对引用。有一个已知错误会阻止 wro4j(使用 cssUrlRewritingProcessor 时)在使用 webjars 时正确重写相对 url。可能的解决方法是用类路径 uri 替换 webjar uri。