Additional display sections in the Maven RPM plugin?

I have a Maven RPM plugin like this:

<mapping> <directory>/etc/myconfig</directory> <configuration>true</configuration> <sources> <source> <location>${project.build.directory}</location> <includes> <include>*.conf</include> </includes> </source> </sources> </mapping> 

However, depending on the packaging process, there may be null .conf files for entering / etc. When this happens, the RPM plugin says:

 [ERROR] Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1.2:rpm (default) on project clients: Unable to copy files for packaging: You must set at least one file. -> [Help 1] 

Is there a way to have a display section that is happy with the inclusion of null files?

+7
maven rpm-maven-plugin
source share
1 answer

The best I could come up with was to leave the <includes> , which takes everything that is specified in the <location> .

location

The input file or directory. If a directory is specified, all files and subdirectories are also included.

You need to be as specific as possible in the way for these mappings that do not include the included templates. I added confs to the location below so as not to pull anything else into project.build.directory .

Even if no files are selected, <directory> will still be created.

 <mapping> <directory>/etc/myconfig</directory> <configuration>true</configuration> <sources> <source> <location>${project.build.directory}/confs</location> </source> </sources> </mapping> 
+2
source share

All Articles