Failed to decode downloaded font前端图标展示不出来
前端项目放在java的resources下面然后打包到测试发现图标展示不出来:
然后控制台报错:
网上说是使用maven打包的时候将fonts下文件损坏了
解决:在主pom里面编辑打包项,并将font分出来false进行打包,解决
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>utf-8</encoding>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<excludes>
<exclude>**/font/**</exclude>
<exclude>**/fonts/**</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<includes>
<include>**/font/**</include>
<include>**/fonts/**</include>
</includes>
</resource>
</resources>
<encoding>utf-8</encoding>
<useDefaultDelimiters>true</useDefaultDelimiters>
</configuration>
</plugin>
</plugins>
</build>
最后重新打包,然后启动项目,注意要ctrl+f5强制刷新一下…
世界上所有的不公平都是由于当事人能力不足造成的.