【问题标题】:Maven RPM plugin not generating correct %files sectionMaven RPM 插件未生成正确的 %files 部分
【发布时间】:2014-04-29 15:53:51
【问题描述】:

我正在使用 Maven RPM 插件构建一个包,它会在 .spec 文件中生成 %files 部分,这种方式会导致安装期间发生冲突。我想在 /usr/bin 中安装一个文件,但 .spec 文件包含以下指令:

%attr(755,root,root) /usr/bin

这会导致 RPM 安装失败,因为与已经拥有该目录的另一个包发生冲突。

我想做的是让 Maven 直接指定文件名,这样可以避免整个问题。这是该特定文件的映射部分:

          <mapping>
            <directory>/usr/bin</directory>
            <filemode>755</filemode>
            <sources>
              <source>
                <location>src/main/scripts/foobar.sh</location>
                <destination>foobar</destination>
              </source>
            </sources>
          </mapping>

有什么建议吗?

(为此我在插件错误跟踪器中打开了issue

【问题讨论】:

    标签: maven scriptlet mojo rpm-maven-plugin


    【解决方案1】:

    正如错误中所指出的,directoryIncluded[1] 映射控制此行为。如果将此设置为 false,您将获得所需的行为。

    [1] - http://mojo.codehaus.org/rpm-maven-plugin/map-params.html#directoryIncluded

    【讨论】:

      【解决方案2】:

      其中一位维护人员在问题跟踪器上回答了我的问题。事实证明,directoryIncluded 映射正是我想要的。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-06-04
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多