Experimental plugin for using Elide from within Gradle.
Make sure to install Elide before proceeding. In GHA, use our elide-dev/setup-elide action to install Elide.
-
Create the javac shim in your JAVA_HOME:
$JAVA_HOME/bin/elide-javac
#!/usr/bin/env bash exec elide javac -- "${@}" -
Install and use the plugin as shown below.
-
That's it! Enjoy faster dependency resolution and Java compilation.
Note
We hope to eliminate the JAVA_HOME shim soon.
gradle.properties
settings.gradle.kts
build.gradle.kts
Elide is a runtime and batteries-included toolchain for Kotlin/Java, Python, JavaScript, and TypeScript, that can be used as a drop-in replacement for javac (among other tools).
Elide builds javac as a native image and includes it within the Elide binary. This plugin changes your Gradle build (as applicable) to use Elide's toolchain facilities instead of Gradle's built-in ones.
The result can be a significant performance improvement for fetching dependencies and compiling code.
Learn more about Elide at elide.dev.
Note
Elide is in beta, and this plugin is experimental. Use at your own risk. Please report any issues you encounter.
- Provide a Gradle plugin
- Provide a Gradle Catalog
- Support for elide install as Gradle's Maven resolver
- Support for elide javac -- ... as Gradle's Java compiler
- Use Elide from the user's PATH
- Use a local copy of Elide within the project
- Gradle-level Elide download cache
- Ability to pin Elide version
- Support the configuration cache
- Race-and-report vs. javac
- Augment project metadata for reporting
- Generate dependency manifests
Elide is a GraalVM native image which functions as a Node- like runtime. It speaks multiple languages, including Java, Kotlin, Python, JavaScript, TypeScript, WASM, and Pkl.
In addition to features which run code (i.e. the runtime!), Elide also is a full batteries-included toolchain for supported languages, including:
- A drop-in replacement for javac and kotlinc
- A drop-in replacement for jar and javadoc
- Maven-compatible dependency resolution and fetching
This plugin configures your Gradle build to use Elide's dependency and/or compile features instead of Gradle's.
Gradle's JavaCompile tasks are configured to use Elide through isFork = true and forkOptions.executable. These point to a shim in the JAVA_HOME which invokes elide javac -- ... instead of javac ....
As a result, JIT warmup is entirely skipped when compiling Java. Projects under 10,000 classes may see better compiler performance, in some cases up to 20x faster than stock javac.
Elide resolves and fetches Maven dependencies with identical semantics to Maven's own resolver, but again in a native image, and with an optimized resolution step (through the use of a checked-in lockfile).
When activated for use with Gradle, a few changes are made to your build:
- An invocation of elide install is added before any Java compilation tasks.
- Gradle is configured for a local Maven repo at .dev/dependencies/m2, which is where Elide puts JARs.
- Thus, when Gradle resolves dependencies, they are already on disk and ready to be used in a classpath.
In this mode, dependencies are downloaded once and then can be used with both Elide and Gradle.
Warning
Fetching dependencies with Elide currently requires an elide.pkl manifest listing your Maven dependencies. This will change in the future.
.png)


