我正在尝试将font-awesome添加到我的AppFuse(v3.0)应用程序中。我添加了网络jars库,如下所示:
<dependency>
<groupId>org.webjars</groupId>
<artifactId>font-awesome</artifactId>
<version>4.0.3</version>
</dependency>
并将 wro.xml 文件修改为:
<!-- CSS URL Rewriting fails when using webjar resource locator:
https://github.com/alexo/wro4j/issues/127 -->
<group name="main">
<css>classpath:META-INF/resources/webjars/bootswatch/3.0.0/spacelab/bootstrap.min.css</css>
<css>/styles/style.css</css>
<css>classpath:META-INF/resources/webjars/font-awesome/4.0.3/css/font-awesome.min.css</css>
<js>classpath:META-INF/resources/webjars/jquery/1.8.3/jquery.min.js</js>
<js>classpath:META-INF/resources/webjars/bootstrap/3.0.2/js/bootstrap.min.js</js>
<js>classpath:META-INF/resources/webjars/jquery-cookie/1.3.1/jquery.cookie.js</js>
<js>/scripts/script.js</js>
</group>
加载页面内容时,出现以下错误:
java.io.IOException: No resource found for wildcard: fontawesome-webfont.woff?v=4.0.3
at ro.isdc.wro.model.resource.locator.wildcard.DefaultWildcardStreamLocator.triggerWildcardExpander(DefaultWildcardStreamLocator.java:175)
at ro.isdc.wro.model.resource.locator.wildcard.JarWildcardStreamLocator.locateStreamFromJar(JarWildcardStreamLocator.java:155)
at ...
java.io.IOException: No resource found for wildcard: fontawesome-webfont.ttf?v=4.0.3
...
etc
看起来检索字体真棒库附带的"字体"文件存在问题。以前有人遇到过这个问题吗?有没有更好的处理方法?
我是 AppFuse 的新手,所以任何帮助将不胜感激。谢谢。
将"fontawesome-webfont.woff?v=4.0.3"替换为"fontawesome-webfont.woff"。"?" 字符被视为特殊字符匹配器。这可以被视为当前版本的 wro4j 的错误,但我会打开一个问题,它将在下一个版本的 wro4j 中修复。