I'm using rpm-maven-plugin to create an rpm of a tarball containing the WARs from my project. I can create an rpm if I already have a tar file. However, I would like to generate the tar file when I run the rpm goal.
I have a script that creates the tar file. I call the script in the prepare step, however the rpm has already been created when the script executes, thus the tar is not included in my rpm.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rpm-maven-plugin</artifactId>
<version>2.1-alpha-4</version>
<executions>
<execution>
<id>generate-rpm</id>
<goals>
<goal>rpm</goal>
</goals>
</execution>
</executions>
<configuration>
<mappings>
<mapping>
<directory>/foo</directory>
<sources>
<source>
<location>DIRECTORY_FOR_MY_TAR</location>
</source>
</sources>
</mapping>
</mappings>
<defineStatements>
<defineStatement>_unpackaged_files_terminate_build 0</defineStatement>
</defineStatements>
<prepareScriptlet>
<script>./../../../../scripts/rpm/prepare/makeATar.sh</script>
</prepareScriptlet>
</configuration>
</plugin>
When I run mvn rpm:rpm
the makeATar script creates a tar in DIRECTORY_FOR_MY_TAR, but it isn't included in my rpm. If I run mvn rpm:rpm
again my tar will successfully be include in the rpm (since it was put into DIRECTORY_FOR_MY_TAR from the execution of makeATar the last time I ran mvn rpm:rpm
).