I'm trying to build an rpm install with rpm-maven-plugin. In addition, I'm also trying to edit my post install script in order to use some Maven properties. For that reason, I'm using maven-resources plugin.
I'm following the answers in this post but it just doesn't work for me and the files aren't filtered and saved in the target directory.
My projects structure :
-my-app
-pom.xml
-app module
-src/..
-pom.xml
-rpm module
-pom.xml
-src/main/
-resources
-scripts
-post-install.sh
In the rpm module pom.xml I have the following two plugins :
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<resources>
<resource>
<directory>src/main/scripts/</directory>
<filtering>true</filtering>
<includes>
<include>post-install.sh</include>
</includes>
</resource>
</configuration>
</plugin>
and also :
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rpm-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
.......
<postinstallScriptlet>
<scriptFile>${basedir}/target/classes/post-install.sh</scriptFile>
<fileEncoding>utf-8</fileEncoding>
</postinstallScriptlet>
When I run mvn package I'm getting the following error :
[ERROR] Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.2.0:rpm (default-rpm) on project my-app-package: Execution default-rpm of goal org.codehaus.mojo:rpm-maven-plugin:2.2.0:rpm failed: Invalid scriptlet declaration found - defined scriptFile does not exist: /root/my-app/rpm/target/classes/post-install.sh -> [Help 1]
I also tried to change the value of the include tag to **/post-install.sh
but it didn't work.