Closed sc1478 closed 6 years ago
Was no problem..just to address this to the correct area... But my question stays...Can you show a full pom file which shows the wrong/missing behaviour ? Have you tested with the most recent version?
I'm using the latest release version, 2.1.4. I've not investigated any others.
This really isn't a bug - it's a missing feature. Simply put a <dirmode> element into any mapping and the build will fail, as of course it should, becuase <dirmode> is not a supported parameter.
But why not? With a handmade rpm spec one can define a different mode on a directory than the rpm default, and this capability is missing from the rpm-maven-plugin. As I am trying to port an existing and extensive rpm-based system to maven, this is a capability I need.
The current solution to accomplish this is to provide a separate mapping exclusively for the directory with the mode you desire.
I don't understand this solution. My original point was that there is no way to specify a <dirmode> for a mapping, and the only way to define the mode at all was by specifying a <defaultDirmode> at the plugin configuration level.
What am I missing?
If a mapping only includes a directory, then the file mode defined is effectively the dir mode.
And if I want a filemode of 640 and a dirmode of 750?
Put the directory and files in different mappings with the desired modes.
<mapping>
<directory>/my/dir</directory>
<directoryIncluded>true</directoryIncluded>
<filemode>750</filemode>
</mapping>
<mapping>
<directory>/my/dir</directory>
<directoryIncluded>false</directoryIncluded>
<filemode>604</filemode>
<sources>
<source>
<location>src/main/stuff</location>
</source>
</sources>
</mapping>
Ok, thanks. A bit kludgey, but it will work.
Might possibly be worth a paragraph on the doc site.
Thanks.
a PR doc is very much appreciated. 2.1.5 release is comming
I wish you could do the following with all these mapping subtags, maybe change filemode to defaultfilemode for example... but user, dirmode, etc... all these settings:
<mappings>
<filemode>644</filemode>
....
<mapping>
<directory>/etc/opt/blahblah</directory>
...
I also wish the syntax of this plugin could be shortened a bunch... well... I mean, I have probably 100 files that need to be installed to 20 different locations... but I think the above wish would solve that issue.
FYI the docs don't appear to tell you what the setting defaults are so I'm forced to set them.
(moved from original misposting on mojohaus parent).
I would like to build an rpm where one directory has a different dirmode than the default. This option is not available, whereas , , and are available on the mapping level. Why the difference?
By the way, this issue has been floating around since 2010:
http://mojo.10943.n7.nabble.com/rpm-maven-plugin-is-there-any-way-to-specify-the-dirmode-other-than-the-defaultDirmode-attribute-td37839.html