如何在pom文件中的rpm映射中排除目录?

时间:2013-06-25 18:47:25

标签: maven-3 maven-plugin

我有一个创建RPM工件的pom文件,RPM会将/tmp/some_script.sh安装到/etc/init.d/some_script

确实可以做到这一点,但它也会在安装/etc/init.d之前尝试安装/etc/init.d/some_script。换句话说,如果我跑:

rpm -qlp my_rpm.rpm

我明白了:

/etc/init.d
/etc/init.d/some_script
.....

如何强制它不安装/etc/init.d


以下是相关配置:

<mapping>
    <directory>/etc/init.d</directory>
    <username>root</username>
    <groupname>root</groupname>
    <sources>
        <source>
            <location>/tmp/some_script.sh</location>
            <destination>some_script</destination>
        </source>
    </sources>
</mapping>

1 个答案:

答案 0 :(得分:13)

根据rpm-maven-plugin

<mapping>
    <directory>/etc/init.d</directory>
    <!-- Set this to false -->
    <directoryIncluded>false</directoryIncluded>
    <username>root</username>
    <groupname>root</groupname>
    <sources>
        <source>
            <location>/tmp/some_script.sh</location>
            <destination>some_script</destination>
        </source>
    </sources>
</mapping>