RPM file not generated using maven rpm plugin
Asked Answered
S

3

10

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

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

When I run the command mvn package rpm:attached-rpm it 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.

Let me know what am I missing here.

Below is the pom I am using

<?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
Sulfonal answered 9/10, 2014 at 12:54 Comment(10)
Do you get any error in the build log? Try running maven with -e -X; also your <packaging> is pom: try changing that to rpm, or alternativealy launch mvn rpm:attached-rpm goal instead of rpm:rpmQuigley
Ran with -e -X. There are no errors but some warnings are seen. [WARNING] cygpath: can't convert empty path sed -s -i -e s/\=\\\\//=\/\//g [WARNING] sed: -e expression #1, char 11: unknown option to s' bash -c "rpmbuild -bb --define _topdir D:/inv-project/target/rpm --target ""_topdir "" org-generic_mediations.spec "" --define ""_build_name_fmt %{ARCH}/%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm"" " [WARNING] bash: -c: line 0: unexpected EOF while looking for matching "' [WARNING] bash: -c: line 1: syntax error: unexpected end of fileSulfonal
@guido: Sorry I couldn't format the above comment. It looks dirty. Let me try the other 2 options mentioned by you.Sulfonal
@guido: I couldn't chnage the packaging to "rpm" as it gave error saying wrong packaging.. whereas with attached-rpm I got, [INFO] Processing files: ORG-generic_mediations-1.0-1.noarch [WARNING] error: No file attributes configured [WARNING] No file attributes configuredSulfonal
strange, because <extensions> element is set to true. Is this an aggregator pom (with modules)?. Also, try to use latest version of maven-rpm-plugin, which is 2.1-alpha-4. Try to paste the logs editing you original questions, not in the comments!Quigley
On using the latest version I am getting error.. Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1-alpha-4:rpm (default) on project inv-project: The parameters 'sourceEncoding' for goal org.codehaus.mojo:rpm-maven-plugin:2.1-alpha-4:rpm are missing or invalid -> [Help 1]Sulfonal
Added logs in the question for reference.Sulfonal
Why are you trying to create an RPM on a windows platform use the appropriate platform for this (Linux!).Singapore
@khmarbaise: Agree but I do not have any linux platform and I don't want to install VM now. I believe cygwin should solve the purposeSulfonal
cygwin is a simulation which is not always accurate which causes more trouble than a real linux (VM ok..use it) makes life easier...Singapore
E
9

Have you verified that you can build the RPM directly via the command line (ie outside of 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:

<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.

Enchantment answered 17/10, 2014 at 22:54 Comment(0)
Z
3

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

  • From Cygwin install rpm, rpm-build and rpm-devel all of version 4.12.0-1
  • Put C:\cygwin64\bin\ on your Windows PATH
  • In your pom.xml, use rpm-maven-plugin 2.5.1
  • Under configuration section set <targetOS>linux</targetOS>

And it should just-work from Maven.

Zendah answered 25/11, 2016 at 19:35 Comment(2)
All that done except rpm-maven-plugin has no explicit version and I still get the error every time :-(Titfer
Worked for me - use version 2.2.0Hirudin
M
0

It is a known issue that 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.

Merchandising answered 2/1, 2015 at 14:45 Comment(1)
Unfortunately the linked issue tracker is gone. But from my experience (see my answer) it just-works now.Zendah

© 2022 - 2024 — McMap. All rights reserved.