目标org.codehaus.mojo的参数'group':rpm -maven-plugin:2.1.5:rpm丢失或无效

Bio*_*eek 6 java pom.xml maven

跑步时

mvn clean rpm:rpm 
Run Code Online (Sandbox Code Playgroud)

我收到此错误:目标org.codehaus.mojo的参数'group':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 &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>
Run Code Online (Sandbox Code Playgroud)

我尝试通过添加或删除project.build.group来修改它,但仍然无效.

我总是得到这个错误.

找到了几个关于'sourceEncoding'缺失或无效问题的主题,但没有关于'组'缺失或无效错误.

bar*_*llo 6

" group "参数不是POM 的通常" groupId ".它指的是通常在文件中定义的一组RPM/usr/share/doc/rpm-$version/GROUPS.这在插件文档中提到.您需要使用正确的组配置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>
Run Code Online (Sandbox Code Playgroud)

  • 嗨尼克.简单地说,我的解决方案是正确的.问题是maven抱怨是因为缺少必需参数,而且我提供的文档链接告诉您如何设置该参数.混淆起因于存在一个名为groupId的*基本maven param*和一个名为*group*的(很少使用的)rpms插件中的无关值.此外,我尝试了最多的投票答案,但没有解决问题.我做了. (2认同)

小智 -1

删除执行标签。留下配置就可以了。