質問

I am trying to add font-awesome to my AppFuse (v3.0) application. I added the webjars library as below:

    <dependency>
        <groupId>org.webjars</groupId>
        <artifactId>font-awesome</artifactId>
        <version>4.0.3</version>
    </dependency>

and modified the wro.xml file to:

<!-- 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>

When loading the contents of the page I get the following errors:

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

It looks like there is a problem with retrieving the "fonts" files that come with font-awesome library. Has anybody ran into this problem before? Is there a better way of handling this?

I am pretty new to AppFuse so any help would be appreciated. Thanks.

役に立ちましたか?

解決

Replace the "fontawesome-webfont.woff?v=4.0.3" with "fontawesome-webfont.woff". The "?" character is treated as a special character matcher. This can be treated as a bug with the current version of wro4j, but I'll open an issue and it will be fixed for next release of wro4j.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top