Maven多模块项目和unix/lf lineEnding问题
我对 Maven 很陌生,遇到了一个我无法解决的问题。我有一个多模块项目设置。在其中一个子模块中,我有一些 Unix bash 脚本。在我的汇编文件中,我想构建一个 zip 文件,其中包含所有行结尾为“unix”或“lf”的 Unix 脚本。当我在子模块级别打包应用程序时,一切都按预期工作(脚本确实具有正确的 Unix 行结尾)。但是,当我在主项目级别打包应用程序时,脚本不会以 Unix 行结尾。这个问题有解决办法吗?谢谢。
这是我的程序集文件的示例片段:(它是在子模块级别为我的子模块之一定义的)
<fileSet>
<directory>src/main/scripts</directory>
<outputDirectory>bin</outputDirectory>
<lineEnding>unix</lineEnding>
<fileMode>0755</fileMode>
</fileSet>
I am very new to Maven and running into a problem that I can't figure out. I have a multi-module project setup. In one of the sub-modules, I have some Unix bash scripts. In my assembly file, I want to build a zip file that contains all my Unix scripts with line ending of either "unix" or "lf". Every thing works as expected when I package my application at the sub-module level (scripts do have the right Unix line ending). However, when I package my application at the master project level, scripts don't end up in Unix line ending. Is there a solution for this problem ? Thanks.
Here is a sample snippet of my assembly file: (which is defined for one of my submodules at the submodule level)
<fileSet>
<directory>src/main/scripts</directory>
<outputDirectory>bin</outputDirectory>
<lineEnding>unix</lineEnding>
<fileMode>0755</fileMode>
</fileSet>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来您遇到了这个错误: http://jira.codehaus.org/browse/MASSEMBLY -237。
只需将程序集插件版本强制为 2.2-beta-3,您的问题就应该得到解决。
Looks like you're running into this bug: http://jira.codehaus.org/browse/MASSEMBLY-237.
Just force the assembly plugin version to 2.2-beta-3 and your problem should be solved.