Followed the Usage Scenarios instructions on this page: 
http://mojo.codehaus.org/rpm-maven-plugin/usage.html

I'm am switching my rpm generation in my maven project from "RPM as Secondary 
Artifact" to "RPM as Primary Artifact".

After creating a new maven module and setting my <packaging> to "rpm" and 
setting the <extensions> to "true" and executing "mvn package" the RPM plugin 
creates a rpm output artifact correctly and it works as described.    The 
maven-rpm-plugin creates a rpm directory tree in the target directory, but it 
does not put the final rpm file in that location instead it places it in my 
$HOME/rpm/RPMS/noarch/[rpm file name].rpm directory.

This is fine, but the problem arises when I run "mvn install" on my project.  
Maven fails with:

[INFO] Installing 
/home/developer/dev/project/modules/test-group/product/target/rpm/product/RPMS/noarch/product-1.0-1.noarch.rpm
 to 
/home/developer/.m2/repository/com/company/product/2.5-SNAPSHOT/product-2.5-SNAPSHOT.rpm
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error installing artifact: File 
/home/developer/dev/project/modules/test-group/product/target/rpm/product/RPMS/noarch/product-1.0-1.noarch.rpm
 does not exist

The maven install goal fails on the rpm module because the rpm plugin places 
the rpm files in the $HOME/rpm location instead of the 
[project]/[module]/target/rpm location.  The install goal is expecting the rpm 
to be in the target/rpm directory tree not the $HOME/rpm directory tree.

Are the further instructions that I have missed or is this a bug?

Has anyone been successful following the instructions for "RPM as Primary 
Artifact" and getting it to work with "mvn install"?


Reply via email to