RPM is the RedHat Package Manager. Windows has ".MSI" packages, but Linux has RPM, DEB, and several other packaging systems, depending on which distro you favor. RPM is the standard for Red Hat, Fedora, CentOS, SuSe and several other major distros.
Loosely speaking, an RPM package is sort of like a ZIPFILE full of installable files plus scripts plus an overall set of directions and specifications. That can also be said of the Debian/Ubuntu DEB package format, although they're actually more like a ZIP file and less into package management details.
RPMS were designed to allow people to:
1. Take generic source code from a site on the Internet and download their source archives (tarballs).
2. Apply patches to make the application specific to the target distro
3. Run a build from source
4. Gather the results of the build and make a pair of RPM files, one for application source, one for binary distribution.
The RPM can then be installed, queried, managed, and validated on the target machine. Information goes into a central RPM database to assist in keeping inventory on what packages are installed on that machine.
RPM was not designed for
Java or
J2EE. You usually don't get much benefit from a source RPM, and you almost never patch Java code, so RPMs built for Java apps downplay those features. However, RPMs are so useful as general package installations that I make almost all of my Linux-deployed project builds into RPMs. WARs and EARs are great, but they only concern the internals of a Java app. RPMs can also manage the external supporting files such as config files, setting up directories to hold files uploaded through the webaapp and other specialized OS-type non-Java functions.
The Ant rpm task is not a different process than the standard RPM build task. The Ant RPM task is in fact, a wrapper for the rpmbuild program, so if rpmbuild is not installed on your machine, the Ant RPM task will fail.
Details on how to build RPMS are available elsewhere - their home site is rpm.org. However, the main points are that you have to setup an RPMbuild directory and you have to provide a ".spec" file which will describe the RPM, list which files will be installed (and where), hold the install/uninstall scripts and do various other things.
It's actually easier to build Java RPMs using Maven than Ant, but I had a lot of practice building RPMs with Ant before I learned to love Maven.