部署springboot项目时 打包成jar时包中html,js,css文件缺失
问题
打包出来的jar包里面没有html,js,css文件
解决方案
在pom.xml
文件下的build选项中的src/main/resources
的目录下 添加配置
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
<include>**/*.css</include>
<include>**/*.js</include>
<include>**/*.html</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</build>