I added the copyright- and distribution- tags to the configuration of the plugin and it worked. The missing copyright- tag was the reason for the error. The plugin created the RPM file under "RpmProject/target/rpm/RPMS/noarch" and named it "myrpmexampleRPM-1.0-SNAPSHOT20090703094450.noarch.rpm".
Now I have questions: - What means the "noarch" in the filename? - What for is the distribution- tag used for? Thanks! -Danny Schimke 2009/7/3 Danny Schimke <[email protected]> > Hello! > > We tried using cygwin, but this was a pain. We had to install many other > packages beside the rpmpackage, which are not delivered with cygwin by > default, to get it to work. The aim is, to make it possible for a developer > to create a RPM package without these difficult steps. We have agreed to > build the RPM package on a unix system and using profiles do differ the > operating system for building the package only under unix. > > I tried to build the RPM using the following POM: > > <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.incowia.rpmexample</groupId> > <artifactId>RpmProject</artifactId> > <packaging>jar</packaging> > <version>1.0-SNAPSHOT</version> > <name>RpmProject</name> > <url>http://maven.apache.org</url> > <dependencies> > <dependency> > <groupId>junit</groupId> > <artifactId>junit</artifactId> > <version>3.8.1</version> > <scope>test</scope> > </dependency> > </dependencies> > <profiles> > <profile> > <id>linux</id> > <activation> > <os> > <family>unix</family> > </os> > </activation> > <build> > <plugins> > <plugin> > <groupId>org.codehaus.mojo</groupId> > <artifactId>rpm-maven-plugin</artifactId> > <version>2.0-beta-2</version> > <executions> > <execution> > <goals> > <goal>attached-rpm</goal> > </goals> > </execution> > </executions> > <configuration> > <group>com.incowia.rpmexample</group> > <mappings> > <mapping> > <directory>/temp</directory> > </mapping> > </mappings> > <name>myrpmexampleRPM</name> > </configuration> > </plugin> > </plugins> > </build> > </profile> > </profiles> > </project> > > [INFO] [jar:jar] > [INFO] [rpm:attached-rpm {execution: default}] > [WARNING] Version string truncated to 1.0 > [INFO] Creating spec file > /home/incowia/projects/RpmProject/target/rpm/SPECS/myrpmexampleRPM.spec > [WARNING] error: License field must be present in package: (main package) > [INFO] Building target platforms: noarch > [INFO] Building for target noarch > [INFO] > ------------------------------------------------------------------------ > [ERROR] BUILD ERROR > [INFO] > ------------------------------------------------------------------------ > [INFO] *RPM build execution returned: '1' executing '/bin/sh -c cd > /home/incowia/projects/RpmProject/target/rpm/SPECS && rpmbuild -bb > --buildroot /home/incowia/projects/RpmProject/target/rpm/buildroot --define > '_topdir /home/incowia/projects/RpmProject/target/rpm' --target noarch > myrpmexampleRPM.spec'* > > > The following Filesstructure is created under "RpmProject/target/rpm": > > BUILD (empty) > + buildroot > temp (empty) > RPMS (empty) > SOURCES (empty) > + SPECS > *myrpmexampleRPM.spec* > SRPMS (empty) > > > The *myrpmexampleRPM.spec *file contains the following: > > Name: myrpmexampleRPM > Version: 1.0 > Release: SNAPSHOT20090703092244 > Summary: RpmProject > Group: com.incowia.rpmexample > BuildRoot: /home/incowia/projects/RpmProject/target/rpm/buildroot > %description > %files > %dir /temp > > Maybe I forgot a important POM- configuration or anything else!? > > Thank you very much! > > -Danny Schimke > > > 2009/6/22 Todd Thiessen <[email protected]> > >> Thanks. This seems to be exactly what the rpm-maven-plugin does. I was >> >> just a little confused that there seems to be 2 plugins. I suspect that >> the maven-rpm-plugin is the core mavenization of the rpm-maven-plugin, >> although the move to the core plugins seems to have been left in a >> somewhat unfinished state as I don't see any site documentation for the >> maven-rpm-plugin. Because of this lack of documentation, we went with >> the codehaus version. >> >> If you could provide any other clarity as to any differences betweenn >> the two plugins, other than the one I stated above, that would be very >> much appreciated. >> >> And I'll pass on the invite to build rpmbuild from source ;-). Cygwin >> definately has it available. >> >> Thanks. >> >> --- >> Todd Thiessen >> >> > //rpm:rpm calls the rpmbuild to package the rpm here is an example >> > >> > $ mvn -e rpm:rpm >> > [INFO] RPM build execution returned: '1' executing 'cmd.exe >> > /X /C "rpmbuild -bb --buildroot >> > $MAVEN_BUILD\maven-plugins\sample\target\rpm\buildroot --define " >> > _topdir f:\maven-plugin\maven-plugins\sample\target\rpm" >> > --target noarch landfil l.spec"' >> > >> > if you feel brave enough to tackle building rpmbuild for your >> > rpmbuild there are some sources avail here >> > http://www.mhonarc.org/release/MHonArc/snapshot/ >> > dev.mk is the makefile you want to start with >> > >> > i have'nt seen any cygwin specific rpmbuild implementations >> > but you can ping the folks at cygwin http://cygwin.com >> > >> > Let us know, >> > Martin >> > >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> > > > -- > Danny Schimke > IT- Consultant > > incowia GmbH > > Albert-Einstein-Straße 3 > D-98693 Ilmenau > www.incowia.com > -- Danny Schimke IT- Consultant incowia GmbH Albert-Einstein-Straße 3 D-98693 Ilmenau www.incowia.com
