运行时
mvn clean rpm:rpm
我收到此错误:目标 org.codehaus.mojo:rpm-maven-plugin:2.1.5:rpm 的参数“组”丢失或无效
我的父 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 >= 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>
我尝试通过添加或删除 project.build.group 来修改它,但仍然不起作用。
我总是遇到这个错误。
发现了几个关于“sourceEncoding”缺失或无效问题的主题,但没有发现“group”缺失或无效错误。
最佳答案
“group”参数不是 POM 中通常的“groupId”。
它指的是 RPM 组,通常在文件 /usr/share/doc/rpm-$version/GROUPS
中定义。
plugin docs 中提到了这一点.
您需要使用正确的组配置 RPM 插件;像这样:
<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>
关于java - 目标 org.codehaus.mojo :rpm-maven-plugin:2. 1.5:rpm 的参数 'group' 丢失或无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37360960/