I am using rpm-maven-plugin to package a spring boot executable jar as an init.d service.
While I am able to set file permissions via plugin configuration (as shown in the code below), I would also like to set a file attribute, namely chattr +i service.jar
.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rpm-maven-plugin</artifactId>
<version>2.1.5</version>
<executions>
...
</executions>
<configuration>
...
<mappings>
<mapping>
<directory>/opt/myservice/bin</directory>
<filemode>500</filemode>
<sources>
<source>
<location>${project.build.directory}/service.jar</location>
</source>
</sources>
</mapping>
...
</mappings>
</configuration>
</plugin>
At the moment, I am thinking about adding post-install and pre-remove scripts to modify the attribute.
Is there a way to achieve this without having to use the scripts?