在jenkins使用maven进行打包发布时,由于maven无法对xml文件进行编译打包,须在pom.xml文件中添加如下配置:

<build>
<finalName>API</finalName>
<resources>
······
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
······
</resources>
</build>





或者

<resources>
  <resource>
    <directory>src/main/java</directory>
    <includes>
      <include>**/*.properties</include>
      <include>**/*.xml</include>
    </includes>
    <filtering>false</filtering>
  </resource>
</resources>


Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐