1.问题:字体文件加载失败,本来应该是“X”号,现在只有一个小方块
2.原因:问题是Maven正在过滤字体文件并破坏它们。
<resource>
<filtering>true</filtering>
<directory>src/main/resources</directory>
<includes>
<include>application-${profileActive}.properties</include>
<include>application.properties</include>
</includes>
</resource>
3.解决方案:不过滤这些font文件
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>ttf</nonFilteredFileExtension>
<nonFilteredFileExtension>woff</nonFilteredFileExtension>
<nonFilteredFileExtension>woff2</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
</plugin>