springboot環境中,可能會出現使用font-Awesome結果圖標不顯示的問題,在webService的pom文件中添加以下配置代碼


<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>

</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>woff</nonFilteredFileExtension>
<nonFilteredFileExtension>woff2</nonFilteredFileExtension>
<nonFilteredFileExtension>eot</nonFilteredFileExtension>
<nonFilteredFileExtension>ttf</nonFilteredFileExtension>
<nonFilteredFileExtension>svg</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
</plugin>
</plugins>
</build>

spring

如已有build和plugins標籤,則將plugin放在plugins標籤的裏面apache

 

或者使用以下配置maven

<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>
相關文章
相關標籤/搜索