The Maven Resources Plugin copies project resources into the output dir during the creation of the WAR. During this phase the plugin performs the filtering operation, where the variables in the resource files are replaced with the specified values. But this filtering operation does not have to be done for binary files, to prevent these files from being corrupted. For example binary files that can be corrupted by the filtering phase of the Maven Resources Plugin are the fonts.
If there are any corrupted fonts in the deployed WAR, just check with the developer’s tools that each browser provides, if there are any errors in the font decoding phase of the browser itself. For example, as in this case:
messages such as “Failed to decode downloaded font”, or “OTS parsing error: Failed to convert WOFF 2 font to SFNT”, or “incorrect file size in WOFF header”, or “GDEF: invalid table offset” are all signs that binary fonts are corrupt.
To avoid these problems just add the exclusions in the configuration section of the plugin in the pom.xml file. For example:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>2.7</version> <configuration> <delimiters> <delimiter>ยง</delimiter> </delimiters> <useDefaultDelimiters>false</useDefaultDelimiters> <nonFilteredFileExtensions> <nonFilteredFileExtension>ico</nonFilteredFileExtension> <nonFilteredFileExtension>jpg</nonFilteredFileExtension> <nonFilteredFileExtension>png</nonFilteredFileExtension> <nonFilteredFileExtension>eot</nonFilteredFileExtension> <nonFilteredFileExtension>svg</nonFilteredFileExtension> <nonFilteredFileExtension>woff</nonFilteredFileExtension> <nonFilteredFileExtension>woff2</nonFilteredFileExtension> <nonFilteredFileExtension>ttf</nonFilteredFileExtension> </nonFilteredFileExtensions> </configuration> </plugin>
in this case all files with extensions declared in nonFilteredFileExtensions will only be copied to the output dir without being filtered.