In order to facilitate the configuration in the project, often use the properties file save configuration information, project started, need to open maven filtering with the properties of the attribute value replace placeholders in the configuration file, for example, I used in the project of c3p0.. the properties file database connection information, so that every time I need to change the database connection information, only need to modify the c3p0. The properties of the file, Using the ${} read value in mybatis config. XML (see figure below), using maven’s Resource plug-in to turn Filtering on, replaces ${} in the XML file with the contents of Properties at compile time.
When I was using Spring Boot, all the files related to my page were placed in the SRC /resource/ directory. After starting the project, the icon of the page (font-awesome is used) could not be used. I have checked the official document and explained as follows: means that turning on The Filtering function using Maven’s Resource plug-in destroys files with binary content.
According to the official document needs to modify the configuration as follows (this project is an example) :
When I was using Spring Boot, all the files related to my page were placed in the SRC /resource/ directory. After starting the project, the icon of the page (font-awesome is used) could not be used. I have checked the official document and explained as follows: means that turning on The Filtering function using Maven’s Resource plug-in destroys files with binary content.
According to the official document needs to modify the configuration as follows (this project is an example) :
<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 directory part content:
After the project is compiled, the files will not be corrupted.
Read More:
- CSS Failed to decode downloaded font, OTS parsing error: Failed to convert WOFF 2.0 font to SFNT
- springboot : Failed to decode downloaded font 和 OTS parsing error
- Spring boot problem 1: error reporting life processing instructions for building a spring boot project
- OTS parsing error: invalid version tag
- How to Fix Failed to open \EFI\BOOT\grubx64.efi Not Found
- The spring boot project was first created, pom.xml The error is Maven configuration problem. How to solve it?
- Failure of spring boot configuration server port
- How to Fix Invalid bound statement (not found) Error
- Spring boot running appears java.lang.IllegalStateException : Failed to load ApplicationContext
- Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.4.0:repackage failed
- Gradle build spring boot failed to find plugins and reported an error
- How to Fix Tomcat Error: Failed to destroy end point associated with ProtocolHandler[ajp-nio-8009]
- How to Fix Error: JavaFX cannot find fxml
- ERROR: Failed to parse POMs (How to Fix)
- Add PageHelper spring boot starter dependency to springboot and report an error
- How to Fix failed to Connect to MySQL at localhost:3306 with user root
- How to Fix The error may exist in com/kuang/dao/UserMapper.xml
- failed: Too many links (How to Fix)
- Failed to configure a DataSource: ‘url’ attribute is not specified and no embedded (How to Fix)
- express nodejs Failed to lookup view error in views directory (How to Fix)