2013-11-21 15 views
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

我失去了什麼造成了另一種映射?

+0

首先嚐試使用[RPM-Maven的插件]的先進的最新版本(http://mojo.codehaus.org/rpm- maven-plugin /),它目前是2.1-alpha-3。 – khmarbaise

+0

@khmarbaise嘗試與最新版本...但相同的結果..請看看更新的問題.. – Bhuvan

回答

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> 
+0

所有的映射應明確設置directoryIncluded配置值。僅用於控制目錄所有權的映射應設置爲true,其他提供內容的映射應將其設置爲false。 –

相關問題