0

Like the question GeoLite2 database gets corrupt when added to jar, I got the error from the WAR file with the following steps:

  1. mvn package to copy GeoLite2-City.mmdb from src/main/resources/GeoLite2-City.mmdb to war file under WEB-INF/classes/GeoLite2-City.mmdb
  2. GeoLite2-City.mmdb was changed in the first step mvn package

I tried the plugin maven-resources-plugin as https://stackoverflow.com/a/34454312/1086907, but GeoLite2-City.mmdb is still changed by mvn package

How to troubleshoot the issue?

Peter
  • 357
  • 3
  • 10

1 Answers1

1

The maven-war-plugin can actually also filter that file.

Just like for the maven-resources-plugin, you can add that mmdb file extension as an additional extension not to be filtered:

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>3.2.0</version>
            <configuration>
                <nonFilteredFileExtensions>
                    <nonFilteredFileExtension>mmdb</nonFilteredFileExtension>
                </nonFilteredFileExtensions>
            </configuration>
        </plugin> 
Tome
  • 3,234
  • 3
  • 33
  • 36
  • Glad it helped. To help future visitors knowing that this question is answered, please click on the grey check and turn it green (see https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work) – Tome Apr 24 '18 at 08:05