如果我们在同一目录上进行两次映射,如何使用已定义的用户组创建目录

时间:2013-11-21 11:51:51

标签: maven maven-plugin rpm-spec rpm-maven-plugin

在我的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文件夹

我缺少什么?

1 个答案:

答案 0 :(得分: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.

由于在这种情况下有两个映射有助于同一目录,因此不会为spec文件中的目录编写%attr。 我们可能需要再添加一个映射,如:

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

    </mapping>