Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Gradle plugin for constructing RPM packages.
Groovy Shell
Latest commit e123391 @AlanKrueger AlanKrueger Merge pull request #53 from fff/master
enable relocatable rpm
Failed to load latest commit information.
gradle/wrapper Upgrade wrapper to 1.7.
src Merge pull request #53 from fff/master
test-rpm add rpm test
.gitignore Configure gradle to also generate IntelliJ project files. Update history and versions following 1.4 release
LICENSE.txt new gradle-rpm-plugin project Update history and versions following 1.4 release
build.gradle Merge pull request #53 from fff/master
gradlew Upgrade wrapper to 1.7.

Gradle RPM plugin

This plugin provides Gradle-based assembly of RPM packages, typically for Linux distributions derived from RedHat. It leverages Redline Java library.


apply plugin: 'rpm'

// ...

buildscript {
    repositories {

    dependencies {
        classpath 'com.trigonic:gradle-rpm-plugin:1.4'

// ...

task fooRpm(type: Rpm) {
    packageName = 'foo'
    version = '1.2.3'
    release = 1
    arch = I386
    os = LINUX

    installUtils = file('scripts/rpm/')
    preInstall = file('scripts/rpm/')
    postInstall = file('scripts/rpm/')
    preUninstall = file('scripts/rpm/')
    postUninstall = file('scripts/rpm/')

    requires('bar', '2.2', GREATER | EQUAL)
    requires('baz', '1.0.1', LESS)

    into '/opt/foo'

    from(jar.outputs.files) {
        into 'lib'
    from(configurations.runtime) {
        into 'lib'
    from('lib') {
        into 'lib'
    from('scripts') {
        into 'bin'
        exclude 'database'
        fileMode = 0550
    from('src/main/resources') {
        fileType = CONFIG | NOREPLACE
        into 'conf'
    from('home') {
        // Creating directory entries (or not) in the RPM is normally left up to redline-rpm library.
        // Use this to explicitly create an entry -- for setting directory fileMode on system directories.
        createDirectoryEntry = true
        fileMode = 0500
        into 'home'
    from('endorsed') {
        // Will tell redline-rpm not to auto create directories, which
        // is sometimes necessary to avoid rpm directory conflicts
        addParentDirs = false
        into '/usr/share/tomcat/endorsed'

    link('/opt/foo/bin/foo.init', '/etc/init.d/foo')


The RPM plugin is a copy task, similar to the Zip and Tar tasks.

Something went wrong with that request. Please try again.