I am trying to package my own project that includes parts of other projects. Here is a snippet from my pom.xml:

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

However, when I try to build an rpm, it errors out with a message similar to the following (repeated a couple of times):

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

Naturally, there is a file in the other project called Apache Software Licence v2.0.txt

Is there a way to tell maven to quote the filenames when generating the spec file? It looks like it is actually rpmbuild that is barfing, but I'm not completely sure.

有帮助吗?

解决方案

http://jira.codehaus.org/browse/MRPM-102 describes an issue where the plugin doesn't handle spaces in filenames correctly. The parser interprets the space as a delimiter between files and the build fails. Patch was submitted, accepted on 14 Apr 2012, for eventually release with version 2.1 of the plugin. Not sure if a nightly build is available.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top