Search code examples
mavenmaven-war-plugin

maven-war-plugin increases size of my resource


I have a file (/src/main/resources/myfile.library) which is gzipped xml. When the plugin copies the file to the target directory it is almost twice the size. I can no longer open the file, no idea what it is or whats happened.

Any ideas? How can I stop the plugin playing with my resources?


Solution

  • Correct @khmarbaise. As usual I found this out after posting the question!

    And here's the fix. Add a filter=false resource for binary eg.

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