After the font and other files are added to the springboot project, the page cannot be recognized, and the browser debugging window reports the following error:
Failed to decode downloaded font: http://localhost:8080/fonts/fontawesome-webfont.woff?v=4.4.0
OTS parsing error: incorrect file size in WOFF header
Failed to decode downloaded font: http://localhost:8080/fonts/fontawesome-webfont.ttf?v=4.4.0
OTS parsing error: incorrect entrySelector for table directory
The solution is to add the following contents to the POM file without filtering the font file
<build>
<plugins>
<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>
</plugins>
</build>
Finally, don’t forget to restart the project!! Clear browser cache
Similar Posts:
- [Solved] Browser Error: Failed to decode downloaded font and OTS parsing error: Failed to convert *** font to ***
- [Solved] Spring Boot Package Error: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0
- Maven warnning: ‘build.plugins.plugin.version’ is missing [How to Solve]
- [Solved] SpringBoot Package Error: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-res
- Maven no main manifest attribute when generate jar for project
- Springboot 2.4 package error, missing web.xml
- [Solved] Spring Start Error: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project gulimall-coupon: There are test failures. Please refer to D:\m1\0613\mall-coup
- Unregistering JMX-exposed beans on shutdown Solution
- [Solved] Dynamic Web Module 3.0 requires Java 1.6 or newer
- [Solved] Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central