Java Maven配置pom.xml build保证所有指定文件必定会被编译打包 防止打包失败

在项目目录里的 pom.xml 里修改或添加,保证所有 xml 和 properties 文件必定会被编译打包#

<build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <includes>
          <include>**/*.properties</include>
          <include>**/*.xml</include>
        </includes>
        <filtering>true</filtering>
      </resource>
      <resource>
        <directory>src/main/java</directory>
        <includes>
          <include>**/*.properties</include>
          <include>**/*.xml</include>
        </includes>
        <filtering>true</filtering>
      </resource>
    </resources>
</build>
本作品采用《CC 协议》,转载必须注明作者和本文链接