Issue
Like the question GeoLite2 database gets corrupt when added to jar, I got the error from the WAR file with the following steps:
mvn package
to copy GeoLite2-City.mmdb fromsrc/main/resources/GeoLite2-City.mmdb
to war file underWEB-INF/classes/GeoLite2-City.mmdb
- 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?
Solution
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>
Answered By - Tome
Answer Checked By - Marilyn (JavaFixing Volunteer)