spring boot 浏览器加载字体 提醒 Failed to decode downloaded font: http://....../字体.woff

去网上查了之后,大多文章的解决方法是在pom中的bulid中的resources节点中排除字体文件

	<build>
	....
		<resources>
			<resource>
				<directory>src/main/resourcesdirectory>
				<filtering>truefiltering>
				<excludes>
					<exclude>static/report/**exclude>
					<exclude>**/*.woffexclude>
					<exclude>**/*.woff2exclude>
					<exclude>**/*.ttfexclude>
				excludes>
			resource>
			<resource>
				<directory>src/main/resourcesdirectory>
				<filtering>falsefiltering>
				<includes>
					<include>static/report/**include>
					<include>**/*.woffinclude>
					<include>**/*.woff2include>
					<include>**/*.ttfinclude>
				includes>
			resource>
		resources>
		.....
	build>

但是我在项目中更改pom文件后,并没有生效,最后我在maven-resources-plugin插件中添加此节点生效了,不知道什么原因。
pom文件中添加此节点,然后clean下项目

			<plugin>
				<groupId>org.apache.maven.pluginsgroupId>
				<artifactId>maven-resources-pluginartifactId>
				<version>3.1.0version>
				<configuration>
					<includeEmptyDirs>trueincludeEmptyDirs>
					
					<resources>
						<resource>
							<directory>src/main/resourcesdirectory>
							<filtering>truefiltering>
							<excludes>
								<exclude>**/*.woffexclude>
								<exclude>**/*.woff2exclude>
								<exclude>**/*.ttfexclude>
							excludes>
						resource>
						<resource>
							<directory>src/main/resourcesdirectory>
							<filtering>falsefiltering>
							<includes>
								<include>**/*.woffinclude>
								<include>**/*.woff2include>
								<include>**/*.ttfinclude>
							includes>
						resource>
					resources>
				configuration>
			plugin>

你可能感兴趣的:(spring,boot,maven)