Skip to content

sinwe/gradle-hazelcast-plugin

Repository files navigation

Gradle Hazelcast cache backend plugin

Build CodeQL Maven Central Version

Java 17 LTS Java 21 LTS Java 25 LTS

A simple settings plugin that enables build caching in Gradle with Hazelcast as the backend.

For a production-ready build cache implementation (featuring node management, usage statistics, health monitoring, replication, access control and more), see Gradle Enteprise.

For an alternative http-based build cache implementation, see HTTP Build Cache Server


Version Compatibility Matrix

Plugin Version Gradle Version Hazelcast Version Minimum JDK Tested JDK LTS Versions Build JDK Notes
0.18+ 8.14.2, 9.0 - 9.5+ 5.7.0 17 17, 21, 25 17+ Gradle 9 requires Java 17+; Gradle 8.x only tested on JDK 17/21 (Gradle 8.x bundles ASM 9.7.1 which does not support JDK 25)
0.17 8.14 - 9.2 5.6.0 17 17, 21, 25 17+ Gradle 9 requires Java 17+; Gradle 8.14.2 is not compatible with JDK 25 — use 8.14 or 8.14.1 if running on JDK 25
0.16 8.14+ 3.10.2 8 8, 11, 17 11+ Gradle 8.14, Java 8 bytecode, Hazelcast 3.10 not officially supported on Java 17
0.15 7.6+ 3.10.2 8 8, 11 11+ Sonatype Central Portal support with gradle-nexus plugin 2.0.0
0.14 6.0+ 3.10.2 8 8, 11 8+ Legacy OSSRH publishing
0.13 and below 5.0+ 3.10.2 8 8, 11 8+ Legacy versions

Notes:

  • Minimum JDK: The minimum JDK version required to run Gradle (and by extension, use this plugin)
  • Tested JDK LTS Versions: The LTS JDK versions that the plugin is known to work with. Version 0.17+ is tested in CI on all listed versions in parallel on every commit
  • Build JDK: JDK version required to build/release the plugin itself (relevant for contributors)
  • Hazelcast Version: Version of Hazelcast library used by the plugin. Note that you'll need to run a compatible Hazelcast server separately
  • Important for v0.18+: Gradle 9 dropped support for Java 8-16. You must have JDK 17+ installed to run Gradle 9. Gradle 8.x is tested only on JDK 17 and 21 — Gradle 8.x ships with ASM 9.7.1 which only supports class files up to JDK 24 (major version 68); JDK 25 support requires Gradle 9.1+.

How to use

Add this to your settings.gradle:

buildscript {
  repositories {
    mavenCentral()
  }

  dependencies {
    classpath "com.github.sinwe.gradle.caching.hazelcast:gradle-hazelcast-plugin:0.18"
  }
}

apply plugin: "com.github.sinwe.gradle.caching.hazelcast"

buildCache {
  // Note: the local cache is disabled by default when applying the plugin
  remote(com.github.sinwe.gradle.caching.hazelcast.HazelcastBuildCache) {
    host = "127.0.0.1"  //support comma separated multiple hosts
    port = 5701
    name = "gradle-build-cache"
    enabled = true
    push = true
  }
}

You can also specify the location and name of the Hazelcast cache via system properties (though values specified in the settings.gradle override the ones specified by system properties):

System property Function Default value
com.github.sinwe.gradle.caching.hazelcast.host host name of the Hazelcast node 127.0.0.1
com.github.sinwe.gradle.caching.hazelcast.port TCP port of the Hazelcast node 5701
com.github.sinwe.gradle.caching.hazelcast.name name of the cache gradle-task-cache

Additional Resources

For detailed setup instructions, refer to the SETUP.md file.

About

Gradle Hazelcast Plugin

Topics

Resources

License

Stars

9 stars

Watchers

3 watching

Forks

Packages

 
 
 

Contributors