Maven rpm plugin does not overwrite files

462 Views Asked by At

I have below configuration in pom.xml file for rpm. I want to copy a jar at specific folder when rpm runs. The code is as below in pom.xml:

<mapping>
   <directory>/var/lib/abc</directory>
   <filemode>777</filemode>
   <username>aaa</username>
   <groupname>aaa</groupname>
   <sources>
       <source>
          <location>/opt/lib/temp.jar</location>
       </source>
   </sources>
</mapping>

The same configuration I have in another pom file for another rpm.

The problem is, when I run the any rpm first it created the folder, copy the file.

Working as expected but I run another rpm file, it generated error that the files are already present and not overwrite those file.

I just want to know, is there any way to overwrite those file or any way avoid the error if the files are already present to that location.

Thanks, Atul

1

There are 1 best solutions below

2
Atul On

The issue has been resolved.

There is strange fix I did:

<filemode>777</filemode>

This line I have to added in pom file, where it was missing.

I thought, it would allow me, as the directoy is already created.