maven-dependency-plugin以二进制模式解压缩文件

问题描述 投票:2回答:2

我们正在使用maven Assembly和Dependency插件来共享子模块之间的资源,如本文所述,http://www.sonatype.com/people/2008/04/how-to-share-resources-across-projects-in-maven/

虽然像属性文件这样的文本文件正在正确解压缩,但二进制模式下的文件(例如pdf文件)在依赖插件解包时会被破坏。

我们通过验证程序集插件创建的存档(zip)将问题范围缩小到依赖插件(解包阶段)

对此的任何帮助都会有很大帮助

maven maven-assembly-plugin maven-dependency-plugin
2个回答
1
投票

在assembly.xml中使用lineEnding或fileMode作为二进制文件将导致它们被破坏 - 如果您在文本资源上应用其中任何一个,请确保为二进制资源使用单独的fileSet。

http://jira.codehaus.org/browse/MASSEMBLY-412


-1
投票

对于那些会遇到类似问题的人,我在这个答案中找到了解决方案:https://stackoverflow.com/a/24282250/2211974

只需验证maven是否未过滤您的二进制文件,以及它是否将配置添加到maven-resource-plugin

<configuration>
    <nonFilteredFileExtensions>
        <nonFilteredFileExtension>bin</nonFilteredFileExtension>
    </nonFilteredFileExtensions>
</configuration>
© www.soinside.com 2019 - 2024. All rights reserved.