<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
resource配置src/main/java目录,includes中的内容表示此目录下所有以.properties、xml结尾的文件会在package时会当做资源文件打包(放在classpath下)include可设置多条,目录下规则之外的其他文件会被忽略(举个例子有下边这么一个pom文件,意思是resources资源下的.properties、xml文件能被扫描进去,但诸如其他文件,比如html就扫描不进去,这么配的结果是服务器启动时,找不到你的html文件)
解决方案 要么在include标签中加入需要被扫描进去的html文件,或者直接不加这一段,默认是把resources资源下的文件扫描进去的
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>