与问题GeoLite2 database gets corrupt when added to jar类似,我通过以下步骤从WAR文件中收到错误:
mvn package
将GeoLite2-City.mmdb从src/main/resources/GeoLite2-City.mmdb
复制到WEB-INF/classes/GeoLite2-City.mmdb
mvn package
我尝试将插件maven-resources-plugin
设为https://stackoverflow.com/a/34454312/1086907,但GeoLite2-City.mmdb仍由mvn package
如何排查问题?
答案 0 :(得分:1)
maven-war-plugin 实际上也可以过滤该文件。
就像 maven-resources-plugin 一样,您可以将 mmdb 文件扩展名添加为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>