解决Spring Boot OTS parsing error: Failed to convert WOFF 2.0
来源:互联网 发布:python lambda * 编辑:程序博客网 时间:2024/06/06 20:40
在项目中为了方便配置,通常会使用properties文件保存配置信息,项目启动时,需要maven开启filtering用properties中的属性值替换掉配置文件中的占位符,比如我的项目中使用c3p0.properties文件保存数据库的连接信息,这样我每次需要修改数据库的连接信息时,只需要修改c3p0.properties中的文件即可,在mybatis-config.xml中使用${}读取值(见下图),使用maven的resource插件开启filtering,在编译时就会将XML文件中的${}替换为properties的内容。
在使用Spring Boot时,我的页面相关的文件都是放在src/resource/目录下,启动项目后,页面的图标(使用的是font-awesome)就无法使用了,查看了官方文档解释如下:
也就是说,使用maven的resource插件开启filtering功能后,会破坏有二进制内容的文件。
按照官方的文档需要修改配置为如下内容(本项目为例):
<resources> <resource> <directory>${project.basedir}/src/main/resources</directory> <filtering>true</filtering> <excludes> <exclude>static/fonts/**</exclude> </excludes> </resource> <resource> <directory>${project.basedir}/src/main/resources</directory> <filtering>false</filtering> <includes> <include>static/fonts/**</include> </includes> </resource> </resources>static目录部分内容:
这样项目编译之后,文件就不会被破坏了。
1 0
- 解决Spring Boot OTS parsing error: Failed to convert WOFF 2.0
- Spring Boot项目页面报错 OTS parsing error: Failed to convert WOFF 2.0
- CSS Failed to decode downloaded font, OTS parsing error: Failed to convert WOFF 2.0 font to SFNT
- Spring Boot + Bootstrap 出现"Failed to decode downloaded font"和"OTS parsing error: Failed to convert W
- MAVEN 编译spring boot + mybatis 出现 Error parsing Mapper XML.
- 解决phpWeb部署 svg/woff/woff2字体 Failed to decode downloaded font
- spring-boot问题1:搭建spring-boot项目报错 Error parsing lifecycle processing instructions
- BUILD FAILED|Error:Error converting bytecode to dex|Cause: Exception parsing classes
- SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://******.wsdl' : failed to load external entity "
- 搭建spring-boot项目报错Error parsing lifecycle processing instructions
- 解决 android "launch error failed to connect to remote vm"
- github error: failed to push some refs to错误解决
- 解决github :error: failed to push some refs to 问题
- [Exception]spring-boot Failed to start component [StandardServer[-1]]
- Failed to convert path to a short DOS path: C:\Windows\system32\java.exe的解决
- 解决:Failed to convert value of type 'java.lang.String' to required type 'java.util.Date';
- spring 事务异常Failed to convert property value of type [$Proxy12] to required type
- spring Failed to convert property value of type [$Proxy10] to required type
- 自定义JSON.stringify方法,兼容老版本浏览器
- leetcode 187. Repeated DNA Sequences
- NY187快速查找素数
- HRBUST 2044 方方正的棋盘
- mina 使用线程池例子及socket并发测试
- 解决Spring Boot OTS parsing error: Failed to convert WOFF 2.0
- Android开发环境笔记
- 一个图理解Appium的设计原理
- hihoCoder 1032 最长回文子串
- 闭关日记 Day10
- Android:windowSoftInputMethod软键盘弹出的问题浅析
- << React Native 入门与实战>>----第1章 React Native简介
- Scanner中next()与nextLine()的区别
- 一、XML的使用