1

在我的 pom.xml

 <artifactId>rpm-maven-plugin</artifactId>
 <version>2.0.1</version>
 <goal>rpm</goal>
...
 <mapping>
          <directory>/etc/conf</directory>
          <username>ME</username>
          <groupname>ME</groupname>

          <sources>
            <source>
              <location>../install.properties</location>
            </source>
          </sources>
</mapping>

...

使用上述/etc/conf文件夹时,请获得ME:ME许可。

         <mapping>
              <directory>/etc/conf</directory>
              <username>ME</username>
              <groupname>ME</groupname>
              <sources>
                <source>
                  <location>../install.properties</location>
                </source>
              </sources>
    </mapping>
    <mapping>
              <directory>/etc/conf</directory>
              <username>ME</username>
              <groupname>ME</groupname>
              <sources>
                <source>
                  <location>../install2.properties</location>
                </source>
              </sources>
    </mapping>

但是当我添加另一个映射时,/etc/conf文件夹会被创建root:root

我错过了什么?

4

1 回答 1

1

文档说:

directoryIncluded
If the value is true then the attribute string will be written for the directory 
if the sources identify all of the files in the directory 
(that is, no other mapping contributed files to the directory). 
This is the default behavior.

由于在这种情况下,有两个映射对同一目录有贡献,因此%attr不会为规范文件中的目录写入。我们可能需要再包含一个映射,例如:

    <mapping>
              <directory>/etc/conf</directory>
              <username>ME</username>
              <groupname>ME</groupname>

    </mapping>
于 2013-11-22T05:19:37.660 回答