java 未使用 maven rpm 插件生成的 RPM 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26278968/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 09:37:58  来源:igfitidea点击:

RPM file not generated using maven rpm plugin

javamavenrpmrpm-maven-plugin

提问by user001

I am trying to create .rpm file of my maven project on my windows machine.

我正在尝试在我的 Windows 机器上创建我的 Maven 项目的 .rpm 文件。

I followed the steps given in the below link to achieve it.

我按照以下链接中给出的步骤来实现它。

http://tim-perry.co.uk/blog/2012/11/22/building_rpms_on_windows_with_maven

http://tim-perry.co.uk/blog/2012/11/22/building_rpms_on_windows_with_maven

When I run the command mvn package rpm:attached-rpmit shows build success, but no rpm file is generated. Instead, it creates a directory named "rpm" under the target and copies all the needed files (as mentioned in pom) under that directory.

当我运行命令mvn package rpm:attached-rpm 时,它显示构建成功,但没有生成 rpm 文件。相反,它会在目标下创建一个名为“rpm”的目录,并将所有需要的文件(如 pom 中提到的)复制到该目录下。

Let me know what am I missing here.

让我知道我在这里缺少什么。

Below is the pom I am using

下面是我正在使用的 pom

<?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/maven-v4_0_0.xsd ">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.org</groupId>
    <artifactId>inv_project</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>pom</packaging>

    <name>inv_project</name>
    <url>http://maven.apache.org</url>



    <build>
       <plugins>
           <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>rpm-maven-plugin</artifactId>
                <version>2.0-beta-1</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>attached-rpm</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <name>PName</name>
                    <release>1</release>
                    <copyright></copyright>
                    <distribution></distribution>
                    <workarea>target/rpm</workarea>
                    <group></group>
                    <mappings>
                    <mapping>
                            <directory>/bin/</directory>
                            <filemode>755</filemode>
                            <username>user</username>
                            <groupname>sysop</groupname>
                            <sources>
                                <source>
                                    <location>test/</location>
                                    <includes>
                                        <include>*.jar</include>
                                    </includes>
                                </source>
                            </sources>
                        </mapping>
                        <mapping>
                            <directory>/conf/</directory>
                            <filemode>755</filemode>
                            <username>user</username>
                            <groupname>sysop</groupname>
                            <sources>
                                <source>
                                    <location>src/resources</location>
                                    <includes>                                      
                                        <include>*.properties</include>
                                    </includes>
                                </source>
                            </sources>
                        </mapping>
                    </mappings>
                    <postinstallScript />
                </configuration>
            </plugin>
     </plugins>
    </build>

</project>

Adding logs

添加日志

    [INFO] --- rpm-maven-plugin:2.0-beta-2:attached-rpm (attach-rpm) @ mvi_cmpipe ---
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=0, ConflictMarker.markTime=0, ConflictMarker.nodeCount=30, ConflictIdSorter.graphTime=0, ConflictIdSorter.topsortTime=0, ConflictIdSorter.conflictIdCount=13, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=1, ConflictResolver.conflictItemCount=27, DefaultDependencyCollector.collectTime=14, DefaultDependencyCollector.transformTime=2}
[DEBUG] org.codehaus.mojo:rpm-maven-plugin:jar:2.0-beta-2:
[DEBUG]    org.apache.maven:maven-plugin-api:jar:2.0:compile
[DEBUG]    org.codehaus.plexus:plexus-archiver:jar:1.0-alpha-5:compile
[DEBUG]       org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8:compile
[DEBUG]          junit:junit:jar:3.8.2:test
[DEBUG]          classworlds:classworlds:jar:1.1-alpha-2:compile
[DEBUG]    org.codehaus.plexus:plexus-utils:jar:1.5.7:compile
[DEBUG]    org.apache.maven:maven-artifact:jar:2.0:compile
[DEBUG]    org.apache.maven:maven-project:jar:2.0:compile
[DEBUG]       org.apache.maven:maven-profile:jar:2.0:compile
[DEBUG]       org.apache.maven:maven-artifact-manager:jar:2.0:compile
[DEBUG]          org.apache.maven:maven-repository-metadata:jar:2.0:compile
[DEBUG]    org.apache.maven:maven-model:jar:2.0:compile
[DEBUG] Created new class realm plugin>org.codehaus.mojo:rpm-maven-plugin:2.0-beta-2
[DEBUG] Importing foreign packages into class realm plugin>org.codehaus.mojo:rpm-maven-plugin:2.0-beta-2
[DEBUG]   Imported:  < project>com.Org.oss.INV.cmpipe.routes:mvi_cmpipe:1.0-SNAPSHOT
[DEBUG] Populating class realm plugin>org.codehaus.mojo:rpm-maven-plugin:2.0-beta-2
[DEBUG]   Included: org.codehaus.mojo:rpm-maven-plugin:jar:2.0-beta-2
[DEBUG]   Included: org.codehaus.plexus:plexus-archiver:jar:1.0-alpha-5
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:1.5.7
[DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:2.0
[DEBUG]   Excluded: org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8
[DEBUG]   Excluded: junit:junit:jar:3.8.2
[DEBUG]   Excluded: classworlds:classworlds:jar:1.1-alpha-2
[DEBUG]   Excluded: org.apache.maven:maven-artifact:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-project:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-profile:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-artifact-manager:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-repository-metadata:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-model:jar:2.0
[DEBUG] Configuring mojo org.codehaus.mojo:rpm-maven-plugin:2.0-beta-2:attached-rpm from plugin realm ClassRealm[plugin>org.codehaus.mojo:rpm-maven-plugin:2.0-beta-2, parent: sun.misc.Launcher$AppClassLoader@33d626a4]
[DEBUG] Configuring mojo 'org.codehaus.mojo:rpm-maven-plugin:2.0-beta-2:attached-rpm' with basic configurator -->
[DEBUG]   (f) artifact = com.Org.oss.INV.cmpipe.routes:mvi_cmpipe:pom:1.0-SNAPSHOT
[DEBUG]   (f) attachedArtifacts = []
[DEBUG]   (f) copyright = 2010, Org Siemens Networks
[DEBUG]   (f) distribution = NAC
[DEBUG]   (f) group = NAC
[DEBUG]   (s) directory = /bin/
[DEBUG]   (s) filemode = 755
[DEBUG]   (s) username = omc
[DEBUG]   (s) groupname = sysop
[DEBUG]   (s) location = D:\INV-project\test
[DEBUG]   (s) includes = [*.jar]
[DEBUG]   (s) sources = [{"D:\INV-project\test" incl:[*.jar]}]
[DEBUG]   (s) directory = /conf/
[DEBUG]   (s) filemode = 755
[DEBUG]   (s) username = omc
[DEBUG]   (s) groupname = sysop
[DEBUG]   (s) location = D:\INV-project\src\resources
[DEBUG]   (s) includes = [*.properties]
[DEBUG]   (s) sources = [{"D:\INV-project\src\resources" incl:[*.properties]}]
[DEBUG]   (f) mappings = [["/bin/" {%attr(755,omc,sysop)} from [{"D:\INV-project\test" incl:[*.jar]}]], ["/conf/" {%attr(755,omc,sysop)} from [{"D:\INV-project\src\resources" incl:[*.properties]}]]]
[DEBUG]   (f) name = ORG-generic_mediations
[DEBUG]   (f) project = MavenProject: com.Org.oss.INV.cmpipe.routes:mvi_cmpipe:1.0-SNAPSHOT @ D:\INV-project\pom.xml
[DEBUG]   (f) projversion = 1.0-SNAPSHOT
[DEBUG]   (f) release = 1
[DEBUG]   (f) summary = mvi_cmpipe
[DEBUG]   (f) workarea = D:\INV-project\target\rpm
[DEBUG] -- end configuration --
[DEBUG] project version = 1.0-SNAPSHOT
[WARNING] Version string truncated to 1.0
[DEBUG] targetArch = noarch
[INFO] Creating directory D:\INV-project\target\rpm
[INFO] Creating directory D:\INV-project\target\rpm\BUILD
[INFO] Creating directory D:\INV-project\target\rpm\RPMS
[INFO] Creating directory D:\INV-project\target\rpm\SOURCES
[INFO] Creating directory D:\INV-project\target\rpm\SPECS
[INFO] Creating directory D:\INV-project\target\rpm\SRPMS
[INFO] Creating directory D:\INV-project\target\rpm\buildroot
[INFO] Copying 1 files to D:\INV-project\target\rpm\buildroot\bin
[INFO] Copying 1 files to D:\INV-project\target\rpm\buildroot\conf
[INFO] Creating spec file D:\INV-project\target\rpm\SPECS\ORG-generic_mediations.spec
[DEBUG] writing attriute string for directory: /bin/
[DEBUG] writing attriute string for directory: /conf/
[DEBUG] About to execute 'cmd.exe /X /C "rpmbuild -bb --buildroot D:\INV-project\target\rpm\buildroot --define "_topdir D:\INV-project\target\rpm" --target noarch ORG-generic_mediations.spec"'
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>SETLOCAL
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>PUSHD .
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>REM Update buildroot path
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>FOR /F "tokens=*" %i in ('cygpath D:\INV-project\target\rpm\buildroot') do SET NEW_BUILDROOT=%i
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>SET NEW_BUILDROOT=/cygdrive/d/ORG/Project/MVI/PM/INV/Eric3g_LTE/trunk/INV/Install/inv-project/target/rpm/buildroot
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>REM Update topdir path
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>SET TOPDIR="_topdir D:\INV-project\target\rpm"
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>SET TOPDIR=D:\INV-project\target\rpm
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>FOR /F "tokens=*" %i in ('cygpath "D:\INV-project\target\rpm"') do SET NEW_TOPDIR=%i
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>SET NEW_TOPDIR=/cygdrive/d/ORG/Project/MVI/PM/INV/Eric3g_LTE/trunk/INV/Install/inv-project/target/rpm
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>REM Replace path in spec-file
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>SET OLD_PATH=D:\ORG\Project\MVI\PM\INV\Eric3g_LTE\trunk\INV\Install\inv-project\target\rpm
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>SET NEW_PATH=\/cygdrive\/d\/ORG\/Project\/MVI\/PM\/INV\/Eric3g_LTE\/trunk\/INV\/Install\/inv-project\/target\/rpm
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>sed -s -i -e s/D:\ORG\Project\MVI\PM\INV\Eric3g_LTE\trunk\INV\Install\inv-project\target\rpm\/\/cygdrive\/d\/ORG\/Project\/MVI\/PM\/INV\/Eric3g_LTE\/trunk\/INV\/Install\/inv-project\/target\/rpm\//g ORG-generic_mediations.spec
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>REM Execute rpmbuild
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>bash -c "rpmb -bb --buildroot /cygdrive/d/ORG/Project/MVI/PM/INV/Eric3g_LTE/trunk/INV/Install/inv-project/target/rpm/buildroot --define ""_topdir /cygdrive/d/ORG/Project/MVI/PM/INV/Eric3g_LTE/trunk/INV/Install/inv-project/target/rpm"" --target "noarch" --define ""_build_name_fmt %{ARCH}/%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm"" ORG-generic_mediations.spec"
[INFO] Building target platforms: noarch
[INFO] Building for target noarch
[INFO] Processing files: ORG-generic_mediations-1.0-1.noarch
[INFO]
[WARNING] error: No file attributes configured
[WARNING]     No file attributes configured
[INFO]
[INFO] RPM build errors:
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>POPD
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>ENDLOCAL
[INFO]
[INFO] --- rpm-maven-plugin:2.0-beta-2:attached-rpm (default-cli) @ mvi_cmpipe ---
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=0, ConflictMarker.markTime=0, ConflictMarker.nodeCount=30, ConflictIdSorter.graphTime=1, ConflictIdSorter.topsortTime=0, ConflictIdSorter.conflictIdCount=13, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=1, ConflictResolver.conflictItemCount=27, DefaultDependencyCollector.collectTime=10, DefaultDependencyCollector.transformTime=2}
[DEBUG] org.codehaus.mojo:rpm-maven-plugin:jar:2.0-beta-2:
[DEBUG]    org.apache.maven:maven-plugin-api:jar:2.0:compile
[DEBUG]    org.codehaus.plexus:plexus-archiver:jar:1.0-alpha-5:compile
[DEBUG]       org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8:compile
[DEBUG]          junit:junit:jar:3.8.2:test
[DEBUG]          classworlds:classworlds:jar:1.1-alpha-2:compile
[DEBUG]    org.codehaus.plexus:plexus-utils:jar:1.5.7:compile
[DEBUG]    org.apache.maven:maven-artifact:jar:2.0:compile
[DEBUG]    org.apache.maven:maven-project:jar:2.0:compile
[DEBUG]       org.apache.maven:maven-profile:jar:2.0:compile
[DEBUG]       org.apache.maven:maven-artifact-manager:jar:2.0:compile
[DEBUG]          org.apache.maven:maven-repository-metadata:jar:2.0:compile
[DEBUG]    org.apache.maven:maven-model:jar:2.0:compile
[DEBUG] Created new class realm plugin>org.codehaus.mojo:rpm-maven-plugin:2.0-beta-2--650166454
[DEBUG] Importing foreign packages into class realm plugin>org.codehaus.mojo:rpm-maven-plugin:2.0-beta-2--650166454
[DEBUG]   Imported:  < project>com.Org.oss.INV.cmpipe.routes:mvi_cmpipe:1.0-SNAPSHOT
[DEBUG] Populating class realm plugin>org.codehaus.mojo:rpm-maven-plugin:2.0-beta-2--650166454
[DEBUG]   Included: org.codehaus.mojo:rpm-maven-plugin:jar:2.0-beta-2
[DEBUG]   Included: org.codehaus.plexus:plexus-archiver:jar:1.0-alpha-5
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:1.5.7
[DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:2.0
[DEBUG]   Excluded: org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8
[DEBUG]   Excluded: junit:junit:jar:3.8.2
[DEBUG]   Excluded: classworlds:classworlds:jar:1.1-alpha-2
[DEBUG]   Excluded: org.apache.maven:maven-artifact:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-project:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-profile:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-artifact-manager:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-repository-metadata:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-model:jar:2.0
[DEBUG] Configuring mojo org.codehaus.mojo:rpm-maven-plugin:2.0-beta-2:attached-rpm from plugin realm ClassRealm[plugin>org.codehaus.mojo:rpm-maven-plugin:2.0-beta-2--650166454, parent: sun.misc.Launcher$AppClassLoader@33d626a4]
[DEBUG] Configuring mojo 'org.codehaus.mojo:rpm-maven-plugin:2.0-beta-2:attached-rpm' with basic configurator -->
[DEBUG]   (f) artifact = com.Org.oss.INV.cmpipe.routes:mvi_cmpipe:pom:1.0-SNAPSHOT
[DEBUG]   (f) attachedArtifacts = [com.Org.oss.INV.cmpipe.routes:mvi_cmpipe:rpm:rpm:1.0-SNAPSHOT]
[DEBUG]   (f) copyright = 2010, Org Siemens Networks
[DEBUG]   (f) distribution = NAC
[DEBUG]   (f) group = NAC
[DEBUG]   (s) directory = /bin/
[DEBUG]   (s) filemode = 755
[DEBUG]   (s) username = omc
[DEBUG]   (s) groupname = sysop
[DEBUG]   (s) location = D:\INV-project\test
[DEBUG]   (s) includes = [*.jar]
[DEBUG]   (s) sources = [{"D:\INV-project\test" incl:[*.jar]}]
[DEBUG]   (s) directory = /conf/
[DEBUG]   (s) filemode = 755
[DEBUG]   (s) username = omc
[DEBUG]   (s) groupname = sysop
[DEBUG]   (s) location = D:\INV-project\src\resources
[DEBUG]   (s) includes = [*.properties]
[DEBUG]   (s) sources = [{"D:\INV-project\src\resources" incl:[*.properties]}]
[DEBUG]   (f) mappings = [["/bin/" {%attr(755,omc,sysop)} from [{"D:\INV-project\test" incl:[*.jar]}]], ["/conf/" {%attr(755,omc,sysop)} from [{"D:\INV-project\src\resources" incl:[*.properties]}]]]
[DEBUG]   (f) name = ORG-generic_mediations
[DEBUG]   (f) project = MavenProject: com.Org.oss.INV.cmpipe.routes:mvi_cmpipe:1.0-SNAPSHOT @ D:\INV-project\pom.xml
[DEBUG]   (f) projversion = 1.0-SNAPSHOT
[DEBUG]   (f) release = 1
[DEBUG]   (f) summary = mvi_cmpipe
[DEBUG]   (f) workarea = D:\INV-project\target\rpm
[DEBUG] -- end configuration --
[DEBUG] project version = 1.0-SNAPSHOT
[WARNING] Version string truncated to 1.0
[DEBUG] targetArch = noarch
[INFO] Copying 1 files to D:\INV-project\target\rpm\buildroot\bin
[INFO] Copying 1 files to D:\INV-project\target\rpm\buildroot\conf
[INFO] Creating spec file D:\INV-project\target\rpm\SPECS\ORG-generic_mediations.spec
[DEBUG] writing attriute string for directory: /bin/
[DEBUG] writing attriute string for directory: /conf/
[DEBUG] About to execute 'cmd.exe /X /C "rpmbuild -bb --buildroot D:\INV-project\target\rpm\buildroot --define "_topdir D:\INV-project\target\rpm" --target noarch ORG-generic_mediations.spec"'
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>SETLOCAL
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>PUSHD .
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>REM Update buildroot path
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>FOR /F "tokens=*" %i in ('cygpath D:\INV-project\target\rpm\buildroot') do SET NEW_BUILDROOT=%i
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>SET NEW_BUILDROOT=/cygdrive/d/ORG/Project/MVI/PM/INV/Eric3g_LTE/trunk/INV/Install/inv-project/target/rpm/buildroot
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>REM Update topdir path
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>SET TOPDIR="_topdir D:\INV-project\target\rpm"
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>SET TOPDIR=D:\INV-project\target\rpm
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>FOR /F "tokens=*" %i in ('cygpath "D:\INV-project\target\rpm"') do SET NEW_TOPDIR=%i
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>SET NEW_TOPDIR=/cygdrive/d/ORG/Project/MVI/PM/INV/Eric3g_LTE/trunk/INV/Install/inv-project/target/rpm
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>REM Replace path in spec-file
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>SET OLD_PATH=D:\ORG\Project\MVI\PM\INV\Eric3g_LTE\trunk\INV\Install\inv-project\target\rpm
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>SET NEW_PATH=\/cygdrive\/d\/ORG\/Project\/MVI\/PM\/INV\/Eric3g_LTE\/trunk\/INV\/Install\/inv-project\/target\/rpm
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>sed -s -i -e s/D:\ORG\Project\MVI\PM\INV\Eric3g_LTE\trunk\INV\Install\inv-project\target\rpm\/\/cygdrive\/d\/ORG\/Project\/MVI\/PM\/INV\/Eric3g_LTE\/trunk\/INV\/Install\/inv-project\/target\/rpm\//g ORG-generic_mediations.spec
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>REM Execute rpmbuild
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>bash -c "rpmb -bb --buildroot /cygdrive/d/ORG/Project/MVI/PM/INV/Eric3g_LTE/trunk/INV/Install/inv-project/target/rpm/buildroot --define ""_topdir /cygdrive/d/ORG/Project/MVI/PM/INV/Eric3g_LTE/trunk/INV/Install/inv-project/target/rpm"" --target "noarch" --define ""_build_name_fmt %{ARCH}/%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm"" ORG-generic_mediations.spec"
[INFO] Building target platforms: noarch
[INFO] Building for target noarch
[INFO] Processing files: ORG-generic_mediations-1.0-1.noarch
[INFO]
[INFO]
[WARNING] error: No file attributes configured
[INFO] RPM build errors:
[WARNING]     No file attributes configured
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>POPD
[INFO]
[INFO] D:\INV-project\target\rpm\SPECS>ENDLOCAL
[DEBUG] Replacing attached artifact com.Org.oss.INV.cmpipe.routes:mvi_cmpipe:rpm:rpm:1.0-SNAPSHOT. Old path D:\INV-project\target\rpm\RPMS\noarch\ORG-generic_mediations-1.0-1.noarch.rpm, new path D:\INV-project\target\rpm\RPMS\noarch\ORG-generic_mediations-1.0-1.noarch.rpm.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.025 s
[INFO] Finished at: 2014-10-09T19:45:00+05:30
[INFO] Final Memory: 6M/62M

回答by 333kenshin

Have you verified that you can build the RPM directly via the command line (ie outside of Maven)?

您是否确认可以通过命令行直接构建 RPM(即在 Maven 之外)?

If not, then this whole discussion is moot, so I'm going to assume so.

如果不是,那么整个讨论都没有实际意义,所以我将假设如此。

In which case, just pass that command into the Maven exec plugin:

在这种情况下,只需将该命令传递给Maven exec 插件

<project>
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.3.2</version>
        <executions>
          <execution>
            <goals>
              <goal>exec</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <executable>rpmbuild</executable>
          <workingDirectory>${basedir}</workingDirectory>
          <arguments>
            <argument>--test</argument>
          </arguments>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

It will perfectly mimic whatever you did on the command line.

它会完美地模仿你在命令行上所做的一切。

Hope that helps.

希望有帮助。

回答by Leif Gruenwoldt

Make sure you're using latest stable versions, I had issues until I upgraded. The often discussed rpmbuild.bathack is notrequired. Instead just use the following environment on Windows 7:

确保您使用的是最新的稳定版本,我在升级之前遇到了问题。经常讨论rpmbuild.bat的黑客必需的。而只是在 Windows 7 上使用以下环境:

  • From Cygwin install rpm, rpm-buildand rpm-develall of version 4.12.0-1
  • Put C:\cygwin64\bin\on your Windows PATH
  • In your pom.xml, use rpm-maven-plugin2.5.1
    • Under configurationsection set <targetOS>linux></targetOS>
  • 从 Cygwin 安装rpmrpm-build以及rpm-devel所有版本4.12.0-1
  • 放在C:\cygwin64\bin\你的窗户上PATH
  • 在您的pom.xml, 使用rpm-maven-plugin2.5.1
    • configuration节集<targetOS>linux></targetOS>

And it should just-work from Maven.

它应该在 Maven 中正常工作。

回答by Brett Okken

It is a known issuethat the rpm-maven-plugin does not work with cygwin. There are multiple blog posts describing how some folks have hacked around to get cygwin to work. A simple google search of rpm-maven-plugin cygwin will show these.

rpm-maven-plugin 不适用于 cygwin,这是一个已知问题。有多篇博客文章描述了一些人如何破解以让 cygwin 工作。对 rpm-maven-plugin cygwin 的简单谷歌搜索将显示这些。