Maven多模块项目和unix/lf lineEnding问题

发布于 2024-10-01 12:25:36 字数 555 浏览 8 评论 0原文

我对 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

悟红尘 2024-10-08 12:25:36

看起来您遇到了这个错误: 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文