【问题标题】:GeoLite2 database gets corrupt when added to warGeoLite2 数据库在添加到战争时会损坏
【发布时间】:2018-04-19 07:51:09
【问题描述】:

就像问题GeoLite2 database gets corrupt when added to jar一样,我通过以下步骤从WAR文件中得到了错误:

  1. mvn package 将GeoLite2-City.mmdb 从src/main/resources/GeoLite2-City.mmdb 复制到WEB-INF/classes/GeoLite2-City.mmdb 下的war 文件中
  2. GeoLite2-City.mmdb 已在第一步更改mvn package

我将插件maven-resources-plugin 尝试为https://stackoverflow.com/a/34454312/1086907,但GeoLite2-City.mmdb 仍然被mvn package 更改

如何解决问题?

【问题讨论】:

    标签: maven


    【解决方案1】:

    ma​​ven-war-plugin 实际上也可以过滤该文件。

    就像 ma​​ven-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> 
    

    【讨论】:

    猜你喜欢
    • 2016-03-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多