2012-04-04 41 views
1

我想打包自己的項目,其中包括其他項目的一部分。下面是我的pom.xml片段:使用rpm-maven-plugin時,如何在名稱中包含空格的文件?

<plugin> 
    <groupId>org.codehaus.mojo</groupId> 
    <artifactId>rpm-maven-plugin</artifactId> 
    ... 
    <mappings> 
    ... 
    <mapping> 
     <directory>${install.target}/contrib</directory> 
     <sources> 
     <source> 
      <location>src/main/resources</location> 
      <includes> 
      <include>contrib/**/*</include> 
      </includes> 
     </source> 
     </sources> 
    </mapping> 
    ... 
    </mappings> 
</plugin> 

但是,當我嘗試建立一個rpm,它的錯誤了一條消息,類似於以下(重複幾次):

error: Two files on one line: /install/path/contrib/project/licences/Apache 
error: File must begin with "/": Software 
error: Two files on one line: /install/path/contrib/project/licences/Apache 
error: File must begin with "/": Licence 
error: Two files on one line: /install/path/contrib/project/licences/Apache 
error: File must begin with "/": v2.0.txt 

當然,另一個項目中有一個文件叫做Apache Software Licence v2.0.txt

有沒有辦法告訴maven在生成spec文件時引用文件名?看起來實際上rpmbuild是barfing,但我並不完全確定。

+0

這是否意味着您在當前maven項目之外使用文件?此外,通常該文件被稱爲LICENSE.txt,其中包含許可證信息。 – khmarbaise 2012-04-04 08:35:46

+0

是的,我正在接受另一個項目並將其複製到我的src/main/resources/contrib文件夾中。另一個項目不是Maven項目,所以我不能將它作爲依賴包含在內。我不控制哪些文件名爲 - 我的理解,這通常只是「許可」,但在這種情況下,該項目的維護者決定把它「Apache軟件許可證」 – MikeD 2012-04-05 21:02:42

+1

http://jira.codehaus.org/browse/ MRPM-102似乎是它可以扯上關係? – user944849 2012-04-06 03:28:04

回答

0

http://jira.codehaus.org/browse/MRPM-102說明一個問題,即插件不能正確處理文件名中的空格。解析器將該空間解釋爲文件之間的分隔符,並且構建失敗。補丁已於2012年4月14日提交,並最終在2.1版插件中發佈。不知道是否有夜間版本可用。

相關問題