Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Gradle Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-gradle-knowledge-patch)
---
name: gradle-knowledge-patch
description: Gradle
version: "9.9.3"
license: MIT
metadata:
author: Nevaberry
---
# Gradle compatibility guidance
Use this skill when upgrading Gradle builds, maintaining build logic or plugins,
or diagnosing toolchains, caches, dependencies, tests, and Tooling API behavior.
Load the topic reference for detailed conditions, examples, and version attribution.
## Reference index
| Reference | Topics |
| --- | --- |
| [CLI, Tooling API, and platforms](references/cli-tooling-platforms.md) | Security fixes, Wrapper, console controls, task diagnostics, daemon operation, Tooling API models, platform fixes |
| [Configuration Cache and lazy modeling](references/configuration-cache-modeling.md) | Cache failures and reuse, property tracking, Isolated Projects, lazy configurations, task inputs, Build Cache streams |
| [Dependencies, publishing, and distributions](references/dependencies-publishing-distributions.md) | Resolution, variants, repositories, verification, publication metadata, archive permissions and assembly |
| [JVM, languages, and build logic](references/jvm-languages-build-logic.md) | Java toolchains, Scala, Kotlin DSL, ANTLR, Groovydoc, plugin validation, settings files, compatibility fixes |
| [Gradle 9 migration](references/migration-gradle-9.md) | Runtime requirements, removed APIs, Kotlin and Groovy migration, project directories, cleanup, deprecations |
| [Testing, quality, and problems](references/testing-quality-problems.md) | Test discovery, reports and metadata, test selection, TestKit, quality tools, Problems API |
## Security update
Upgrade from Gradle 9.8.0 to at least 9.8.1 for fixes to unauthenticated
deserialization in worker-to-daemon and client-to-daemon communication.
Gradle 9.8.1 also fixes repository disabling when an SSL connection cannot be established.
## Breaking changes and migration
### Runtime and plugin requirements
The Gradle 9 daemon requires JVM 17 or newer. The Wrapper, command-line launcher,
Tooling API client, and TestKit can still run on JVM 8 and start a build using a newer JVM.
Gradle 9.0.0 raises the minimum supported Kotlin Gradle Plugin to `2.0.0`,
Android Gradle Plugin to `8.4.0`, and Gradle Enterprise plugin to `3.13.1`.
Plugins built with Gradle 9 using the Kotlin DSL require Gradle 8.11 or later by default
because they publish Kotlin 2 metadata. Target an earlier Kotlin 1.x version to support
older Gradle releases. Plugins built with the Groovy DSL require Gradle 7.0 or later.
### Project directories and Kotlin build logic
Gradle fails during configuration if an included project's directory is missing,
read-only, or points to a file. Create the directory before configuration or set
`project(":child").projectDir = file("modules/child")` in settings to an existing writable directory.
Replace `this@Build_gradle`, `this@Settings_gradle`, and `this@Init_gradle` with
`project`, `settings`, and `gradle`, respectively. Rename or capture top-level
declarations that those labels were used to disambiguate.
JSpecify annotations enforce non-null type arguments on APIs such as `Provider<T>`
and `Property<T>`. Use an `Any` bound on generic Kotlin extensions; represent optional
values with an unset `Property<String>`, which callers can read with `orNull`.
```kotlin
fun <T : Any> Provider<T>.isConfigured(): Boolean = isPresent
```
### Removed APIs
| Removed API or behavior | Supported migration |
| --- | --- |
| `Convention`, `Project.getConvention()`, `Task.getConvention()` | Move base plugin settings to `base`; move WAR, EAR, and project-report convention settings onto their tasks. |
| `Project.exec`, `Project.javaexec`, and script counterparts | Inject `ExecOperations` in task actions, or use `providers.exec` and `providers.javaexec` for lazy process output as a build input. |
| `kotlinDslPluginOptions.jvmTarget` | Set a Java toolchain in the build applying `kotlin-dsl`. |
| `"name"()` object lookup | Use `named("name")`, such as `tasks.named("check")` in a project applying `base`. |
| `WriteProperties.outputFile` | Use `destinationFile`. |
| `fileMode` and `dirMode` assignments | Use `filePermissions { ... }` and `dirPermissions { ... }`. |
| `incrementalScalaAnalysisFor` configurations | Remove custom build logic that looks for them by name. |
The migration reference also covers source directory sets, collection utilities,
Groovy closure configuration, API subclassing, IDEA directories, and cache cleanup.
### Test discovery and custom tasks
A separately registered `Test` task can skip execution if it relied on inheriting
the default test source set. Set `testClassesDirs` and `classpath` explicitly or
register another target of the existing JVM test suite.
```kotlin
testing.suites.named<JvmTestSuite>("test") {
targets.register("otherTest")
}
```
If a test task runs with test sources and discovers zero tests, it fails when no
filters were applied. Set `failOnNoDiscoveredTests = false` to allow zero discoveries.
Filtered runs use `failOnNoMatchingTests`.
### Archives and publication setup
Archive tasks use deterministic entry order and fixed timestamps and permissions.
Set executable permissions explicitly for packaged scripts that need them.
Use `useFileSystemPermissions()` to preserve source permissions, or set
`org.gradle.archives.use-file-system-permissions=true` for all archive tasks.
Custom artifacts that relied on implicit attachment to `assemble` need explicit wiring.
For an existing `packageDocs` task:
```kotlin
tasks.named("assemble") {
dependsOn("packageDocs")
}
```
The `archives` configuration stops collecting artifacts from other configurations
based on visibility. Configure a component before creating its publication: modifying
Gradle Module Metadata after eagerly populating a publication from that component fails.
## Deprecations and upcoming removals
Gradle warns when property or method lookup resolves through a parent project,
including `findProperty()`, `property()`, and `hasProperty()`. Gradle 10 removes this
fallback. Migrate shared values to `gradle.properties`, move shared logic into convention
plugins, or use explicit references, then enable the removal early in settings:
```kotlin
enableFeaturePreview("NO_IMPLICIT_LOOKUP_IN_PARENT_PROJECTS")
```
- For ANTLR 4, use `AntlrTask.packageName`; passing `-package` directly is deprecated and becomes an error in Gradle 10.0.0.
- `ReportingExtension.file(String)` is deprecated.
- The `JavaForkOptions.setAllJvmArgs(...)` overloads that replace the full forked JVM argument list are deprecated.
- `ResolvedArtifactResult.getAttributes()` and `getCapabilities()` expose metadata directly. Gradle plans to deprecate `ResolvedArtifactResult.getVariant()` in a future release.
## Configuration Cache and lazy modeling
### Failure handling and diagnostics
Gradle can automatically run without the Configuration Cache for known unsupported
features, such as source dependencies or incompatible Eclipse or IDEA tasks.
Check the Configuration Cache report for the reason.
An execution-time Configuration Cache problem aborts the task immediately and prevents
up-to-date marking or output caching. In warning mode, tasks marked incompatible prevent
reuse of the Configuration Cache entry. Check the report for unsafe concurrent access
and Groovy DSL closures capturing script state.
Enable integrity checks when diagnosing Configuration Cache serialization or loading failures.
They can identify the task field and codec involved and increase cache size and read/write time.
```properties
org.gradle.configuration-cache.integrity-check=true
```
### Property inputs and reuse
- Changing a `-P` property can reuse the cache entry when its provider is read only during task execution. Direct configuration-time reads through `gradle.startParameter.projectProperties` are tracked and can invalidate it.
- A changed project property in `gradle.properties` can reuse the entry when unused during configuration; a task reading its provider during execution sees the updated value.
- Changes via `-Dorg.gradle.project.<name>=<value>` or `ORG_GRADLE_PROJECT_<name>` can reuse the entry if configuration never reads that property. Execution-time reads through `providers.gradleProperty(...)` get the current value, even when switching between those sources.
Read-only mode reuses existing entries and skips storing new entries on a miss:
```sh
./gradlew build --configuration-cache -Dorg.gradle.configuration-cache.read-only=true
```
### Isolated Projects and task inputs
Enable incubating Isolated Projects with `--isolated-projects` or
`org.gradle.isolated-projects=true` in a Configuration Cache-compatible build.
Access to mutable state such as `project(":other").tasks` or `gradle.extensions`
fails by default. Legacy `org.gradle.unsafe.isolated-projects` names are deprecated aliases.
Use `Property<ResolutionResult>` as a task input with the Configuration Cache to
analyze `allComponents` and `allDependencies` without downloading artifacts.
`DomainObjectCollection.getElements()` exposes a provider whose wiring into task inputs
carries producer task dependencies from providers registered with `addLater` or `addAllLater`.
## JVM toolchains and build logic
With a toolchain resolver configured in `settings.gradle.kts`, `updateDaemonJvm`
records per-platform `toolchainUrl.<OS>.<ARCH>` entries in
`gradle/gradle-daemon-jvm.properties`. Gradle downloads a daemon JDK from those URLs
when no local installation matches the criteria.
```sh
./gradlew updateDaemonJvm --jvm-version=17
```
Use `nativeImageCapable` to require a JDK with GraalVM Native Image support;
daemon toolchain selection also supports this criterion.
The `scala` and `scala-base` plugins accept Scala 2 or 3 through `scala.scalaVersion`.
With `scala`, this removes the need to declare the Scala standard library explicitly.
Plugin projects using `com.gradle.plugin-publish`, `ivy-publish`, or `maven-publish`
enable stricter validation by default, including missing task input annotation checks.
A property annotated only with `@Optional` needs an input/output annotation, or
`@Internal` if ignored. Combining `@Internal` and `@Optional` produces a dedicated error;
remove `@Optional` from such properties.
## CLI and diagnostics
| Task | Command or setting |
| --- | --- |
| Print the dependency tree and skip task execution | `./gradlew build --task-graph` |
| Show task registration sources | `./gradlew tasks --provenance` or `./gradlew help --task assemble` |
| Diagnose ambiguous transform selection | `./gradlew :app:artifactTransforms` |
| Inspect attribute disambiguation precedence | `./gradlew resolvableConfigurations` |
| Disable all interactive prompts for an invocation | `./gradlew build --non-interactive` |
| Disable interactive prompts for builds using a properties file | `org.gradle.console.interactive=false` in `gradle.properties` |
| Suppress colors while retaining other styling and rich console features | Set `NO_COLOR` to any non-empty value. |
Wrapper distribution download retries are disabled by default. Configure `retries`
and `retryBackOffMs` in `gradle/wrapper/gradle-wrapper.properties`; the initial delay
is in milliseconds and doubles on successive failures.
Starting with Gradle 9.9, the `wrapper` task preserves existing Wrapper settings
when updating the Gradle version.
## Tests and problem reports
Set `Test.testDefinitionDirs` for JUnit Platform test definitions when a task has no
test classes. Gradle 9.9 can filter JUnit Platform tests with no backing test method.
HTML reports capture JUnit Platform `TestReporter.publishEntry` and `publishFile`
data in Data and Attachments tabs, including construction, setup, and teardown.
Attach typed Problems API payloads with `ProblemSpec.additionalData(Data.class, action)`;
`Data` extends `org.gradle.api.problems.AdditionalData`. Tooling API clients read them
through `CustomAdditionalData.get(View.class)` with matching getter interfaces.
Use `--warning-mode=all` to show relevant Problems API entries in the console.
Gradle captures full traces for the first 50 problems and source locations for up to
2,000 more by default; this option captures a location for every problem, with shortened
traces after the first 50. Setting `org.gradle.warning.mode=none` suppresses the Problems
HTML report link while Gradle still generates the report.