I've been all over the official documentation without finding an answer. There don't seem to be any parameters for affecting the name of the generated rpm.
I'm doing the rpm:rpm goal on this:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.whatever</groupId>
<artifactId>myapp</artifactId>
<version>0.3.5</version>
<name>myapp</name>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rpm-maven-plugin</artifactId>
<version>2.1.4</version>
<executions>
<execution>
<id>generate-rpm</id>
<goals>
<goal>rpm</goal>
</goals>
</execution>
</executions>
<configuration>
<group>Application/Engineering</group>
<changelogFile>src/changelog</changelogFile>
<mappings>
...
</mappings>
</configuration>
</plugin>
and it's generating for me an RPM called
myapp-0.3.5.noarch.rpm-0.3.5-1.noarch.rpm
.
I'd expect myapp-0.3.5.noarch.rpm
or myapp-0.3.5-1.noarch.rpm
.
Why the repeated version number and "noarch.rpm"? What am I doing wrong?
Also, with the above configuration, this RPM is not installed into the local .m2 repository if we execute the install goal. As an exercise, given the official sample, what name should we expect the generated rpm to have? Documentation doesn't say.
Or maybe I just don't understand what the plugin authors mean by "RPM as Side Effect" in labeling this scenario.
If I change the execution above to
<executions>
<execution>
<id>attach-rpm</id>
<goals>
<goal>attached-rpm</goal>
</goals>
</execution>
</executions>
as described in the "RPM as Secondary Artifact" section then, lo and behold, the plugin does what I was expecting, i.e. it generates myapp-0.3.5.noarch.rpm and puts in in the m2 repository in the expected place.
I guess that's "the answer" to my question, but it's still kinda weird. Based on the description, I'm not surprised that the "secondary" option puts the rpm into the m2 repo, but I don't understand the odd naming. IMHO, the nomenclature and descriptions of these options is lacking something.