Skip to content

rife2/rife2-gradle

Repository files navigation

License Java GitHub CI Tests

RIFE2 Gradle Plugin

This project provides a Gradle plugin for RIFE2 applications.

Using this plugin in your project can be done by adding the following to your Gradle build.gradle.kts file:

plugins {
    application
    id("com.uwyn.rife2") version "1.1.0"
    // ...
}

NOTE: the RIFE2 Gradle plugin relies on the presence of the application plugin

Afterwards, the rife2 extension becomes available, and you can use it like this:

rife2 {
    version.set("1.7.3")                                    // set the RIFE2 version to use
    useAgent.set(true)                                      // set whether to run with the RIFE2 agent
    uberMainClass.set("hello.AppUber")                      // set a different main class to use for the UberJar
    precompiledTemplateTypes.add(HTML)                      // template types that should be pre-compiled
    templateDirectories.from(file("src/main/templates"))    // additional template directories to use
    includeServerDependencies.set(true)                     // set whether to include the embedded server deps
}

The usual run, test, jar tasks are still available, the RIFE2 plugins adds the following:

  • precompileTemplates : performs the template pre-compilation of the activated types
  • uberJar : creates an Uber Jar with everything to run your application standalone

GraalVM Native Image support

When your project uses the GraalVM Gradle plugin, the RIFE2 Gradle plugin will automatically configure the GraalVM plugin to properly include the web application resources into the native image.

Get in touch

Thanks for using RIFE2!

If you have any questions, suggestions, ideas or just want to chat, feel free to post on the forums, to join me on Discord or to connect with me on Mastodon.