This error occurs when you specify the rpm plugin and its configuration in a single pom file and try to create it from the parent directory. In this case, maven will run the rpm:rpm target for all projects, so the rpm plugin will also be applied to all projects that may not have a configuration for the rpm plugin.
Decision:
Pull this plugin to separate the child module.
In your case, create, for example. rpm-package module with the whole profile:
<?xml version="1.0" encoding="UTF-8"?> <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> <parent> <groupId>net.brewspberry</groupId> <artifactId>brewspberry-rpm-parent</artifactId> <version>0.1.0-SNAPSHOT</version> </parent> <artifactId>rpm-package</artifactId> ... <profiles> <profile> <id>rpm-build</id> ... </profile> </profiles> </project>
And in your parent pom.xml:
<modules> ... <module>rpm-package</module> </modules>
Remember to update the source image paths.
Now you can run:
mvn clean package
In addition, see How to make this plugin only on platforms other than Windows? if you also create windows.
source share