Parameter group for target org.codehaus.mojo: rpm-maven-plugin: 2.1.5: rpm missing or invalid

At startup

mvn clean rpm:rpm 

I get this error: Parameter group for target org.codehaus.mojo: rpm-maven-plugin: 2.1.5: rpm are missing or invalid

My parent is pom.xml:

 <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>net.brewspberry</groupId> <artifactId>brewspberry-rpm-parent</artifactId> <version>0.1.0-SNAPSHOT</version> <name>brewspberry-rpm-parent</name> <description>brewspberry-rpm-parent</description> <packaging>pom</packaging> <properties> <rpm.install.basedir>/opt/tomcat</rpm.install.basedir> <rpm.install.webapps>${rpm.install.basedir}/webapps</rpm.install.webapps> <rpm.install.config>${rpm.install.basedir}/lib</rpm.install.config> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.group>Internet</project.build.group> </properties> <modules> <module>brewspberry-regulator-algo</module> <module>brewspberry-api</module> <module>brewspberry-core</module> <module>brewspberry-jbatches</module> <module>brewspberry-webapp</module> </modules> <profiles> <profile> <id>rpm-build</id> <activation> <property> <name>build-rpm</name> </property> </activation> <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>rpm-maven-plugin</artifactId> <version>2.1</version> <extensions>true</extensions> <executions> <execution> <goals> <goal>rpm</goal> </goals> <configuration> <classifier>${rpm.classifier}</classifier> <copyright>Biologeek</copyright> <icon>src/main/resources/img/icon.png</icon> <distribution>Brewspberry</distribution> <targetOS>linux</targetOS> <needarch>noarch</needarch> <group>Internet</group> <packager>${user.name}</packager> <changelogFile>CHANGELOG</changelogFile> <defaultDirmode>540</defaultDirmode> <defaultFilemode>440</defaultFilemode> <defaultUsername>tomcat</defaultUsername> <defaultGroupname>tomcat</defaultGroupname> <properties> <project.build.sourceEncoding>utf-8</project.build.sourceEncoding> <project.build.group>net.brewspberry</project.build.group> </properties> <requires> <require>apache-tomcat &gt;= 8.0.24</require> </requires> <mappings> <mapping> <directory>${rpm.install.webapps}/brewspberry-api</directory> <sources> <source> <location>./brewspberry-api/target/brewspberry-api/target/brewspberry-api-0.1.0-SNAPSHOT.war</location> </source> </sources> </mapping> <mapping> <directory>${rpm.install.webapps}/brewspberry-webapp</directory> <sources> <source> <location>./brewspberry-webapp/target/brewspberry-webapp/target/brewspberry-api-0.1.0-SNAPSHOT.war</location> </source> </sources> </mapping> </mappings> <postinstallScriptlet> <scriptFile> src/main/resources/rpm/postinstall.sh </scriptFile> <fileEncoding>utf-8</fileEncoding> </postinstallScriptlet> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile> </profiles> 

I tried changing it by adding or removing the project.build.group file, but still not working.

I always get this error.

Found several topics about the "sourceEncoding" error or invalid problem, but nothing about the "group" is missing or invalid.

+5
source share
4 answers

The " group " parameter is not the usual " groupId " POM. Instead, it refers to the RPM group , which is usually defined in the file /usr/share/doc/rpm-$version/GROUPS . This is mentioned in plugins . You need to configure the RPM plugin with the right group; something like that:


 <plugins > ... <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>rpm-maven-plugin</artifactId> <version>2.1.5</version> <configuration> <group>Development/Tools</group> </configuration> </plugin> ... </plugins> 
+4
source

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> <!-- I would rename it, parent is not rpm anymore --> <artifactId>brewspberry-rpm-parent</artifactId> <version>0.1.0-SNAPSHOT</version> </parent> <artifactId>rpm-package</artifactId> ... <!-- move entire block "profiles" here --> <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.

+2
source

Remove the execution tags. Just leave the configuration.

0
source

In my case, I needed to add ...

 <properties> <project.build.sourceEncoding>utf-8</project.build.sourceEncoding> </properties> 
0
source

All Articles