Spring Boot项目中的字体文件问题_Failed to decode downloaded font

1.问题:字体文件加载失败,本来应该是“X”号,现在只有一个小方块

Spring Boot项目中的字体文件问题_Failed to decode downloaded font_第1张图片

 

2.原因:问题是Maven正在过滤字体文件并破坏它们。

<resource>
     <filtering>truefiltering>
                <directory>src/main/resourcesdirectory>
                <includes>
                    <include>application-${profileActive}.propertiesinclude>
                    <include>application.propertiesinclude>
                includes>
            resource>

 

3.解决方案:不过滤这些font文件

<plugin>
                <groupId>org.apache.maven.pluginsgroupId>
                <artifactId>maven-resources-pluginartifactId>
                <configuration>
                    <nonFilteredFileExtensions>
                        <nonFilteredFileExtension>ttfnonFilteredFileExtension>
                        <nonFilteredFileExtension>woffnonFilteredFileExtension>
                        <nonFilteredFileExtension>woff2nonFilteredFileExtension>
                    nonFilteredFileExtensions>
                configuration>
            plugin>

Spring Boot项目中的字体文件问题_Failed to decode downloaded font_第2张图片

 

转载于:https://www.cnblogs.com/rocker-pg/p/9470195.html

你可能感兴趣的:(java,javascript,开发工具)