OTS parsing error: incorrect entrySelector for table directory报错解决,font-awesome字体图标无法显示

avatar 2018年01月02日21:20:47 6 7260 views
博主分享免费Java教学视频,B站账号:Java刘哥 ,长期提供技术问题解决、项目定制:本站商品点此
在使用 SpringBoot 的时候,准备使用 font-awesome 字体图标,但是发现图标显示不出来。





问题原因是 Maven 拦截了font 字体类型文件。

只需要将拦截放开即可。



具体做法

修改 pom.xml
  1. <build>
  2.         <resources>
  3.             <resource>
  4.                 <directory>src/main/resources</directory>
  5.                 <filtering>true</filtering>
  6.                 <excludes>
  7.                     <exclude>static/bower_components/font-awesome/fonts/**</exclude>
  8.                 </excludes>
  9.             </resource>
  10.             <!-- fonts file cannot use filter as the data structure of byte file will be changed via filter -->
  11.             <resource>
  12.                 <directory>src/main/resources</directory>
  13.                 <filtering>false</filtering>
  14.                 <includes>
  15.                     <include>static/bower_components/font-awesome/fonts/**</include>
  16.                 </includes>
  17.             </resource>
  18.         </resources>
  19.     </build>

在 build 标签内添加 3-19 行代码



重启后,就能显示了







如果上面的无效,可以试试改成这个
  1. <resources>
  2.     <resource>
  3.         <directory>${project.sources}</directory>
  4.         <filtering>true</filtering>
  5.         <excludes>
  6.             <exclude>**/*.woff</exclude>
  7.             <exclude>**/*.ttf</exclude>
  8.         </excludes>
  9.     </resource>
  10.     <resource>
  11.         <directory>${project.sources}</directory>
  12.         <filtering>false</filtering>
  13.         <includes>
  14.             <include>**/*.woff</include>
  15.             <include>**/*.ttf</include>
  16.         </includes>
  17.     </resource>
  18. </resources>





本文链接:https://liuyanzhao.com/7111.html

  • 微信
  • 交流学习,服务定制
  • weinxin
  • 个人淘宝
  • 店铺名:言曌博客咨询部

  • (部分商品未及时上架淘宝)

发表评论

avatar 登录者:匿名
匿名评论,评论回复后会有邮件通知

  

已通过评论:0   待审核评论数:0