Skip to content
Back to skills

Gradle Knowledge Patch

ASecurity

Gradle

  • 25 stars
  • 0 votes
  • 0 copies
  • 10 views
  • Added September 5, 2026
developmentjavakotlintestingdebuggingapisecurity

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 8 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill gradle-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Gradle Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Gradle Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-gradle-knowledge-patch-nevaberry-plugins/badge)](https://www.skillsdirectory.com/skills/nevaberry-gradle-knowledge-patch-nevaberry-plugins)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: gradle-knowledge-patch
description: Gradle
version: "9.9.3"
license: MIT
metadata:
  author: Nevaberry
---


# Gradle compatibility and build guidance

Load this skill when upgrading Gradle or working on the build behavior indexed below.
Use the quick reference for migration decisions and common configuration tasks.
Open the relevant topic file for complete guidance, examples, compatibility fixes, and attribution.

## Reference index

| Reference | Topics |
| --- | --- |
| [Gradle 9 upgrade](references/gradle-9-upgrade.md) | Runtime requirements, removed APIs, Kotlin and Groovy migration, project directories, deprecations |
| [Configuration Cache and laziness](references/configuration-cache-and-laziness.md) | Cache modes, input tracking, Isolated Projects, providers, lazy collections, custom build caches |
| [Daemon, CLI, Wrapper, and platforms](references/daemon-cli-and-platforms.md) | Security fixes, toolchains, Wrapper downloads, console controls, task inspection, initialization |
| [Dependencies, publishing, and distributions](references/dependencies-publishing-and-distribution.md) | Resolution, variants, repositories, publications, assembly, archives, signing and verification |
| [Testing and quality](references/testing-and-quality.md) | Test discovery, framework configuration, reports, metadata, TestKit output, quality tools |
| [Tooling, problems, and build logic](references/tooling-problems-and-build-logic.md) | Tooling API, Problems API, plugin authoring, validation, Scala, ANTLR, Groovydoc |

## Upgrade requirements and breaking changes

### Security and runtime requirements

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.

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`.

### Removed APIs and project configuration

Gradle 9 removes `Project.exec`, `Project.javaexec`, and their counterparts in build, settings, and init scripts.
Inject `ExecOperations` for process calls in task actions, or use `providers.exec` and `providers.javaexec` to expose process output as a lazy build input.

Gradle 9 removes the `Convention` API, including `Project.getConvention()` and `Task.getConvention()`.
Move base plugin settings to the `base` extension and WAR, EAR, and project-report convention settings onto their corresponding tasks.

Replace `fileMode` and `dirMode` assignments with `filePermissions { ... }` and `dirPermissions { ... }`.
The `WriteProperties` task requires `destinationFile` instead of the removed `outputFile` property.
Replace the removed Kotlin DSL `"name"()` object lookup with `named("name")`.

An included project's directory must exist, be writable, and be a directory for configuration to succeed.
Create it before configuration or set `project(":child").projectDir = file("modules/child")` in settings to point to an existing writable directory.

### Kotlin build logic and nullability

Gradle embeds Kotlin 2.2.x and compiles Kotlin DSL build logic with K2 at language level 2.2.
JSpecify annotations enforce non-null type arguments on APIs such as `Provider<T>` and `Property<T>`.
Add an `Any` bound to generic Kotlin extensions; represent optional values with an unset `Property<String>` and read them with `orNull`.

```kotlin
fun <T : Any> Provider<T>.isConfigured(): Boolean = isPresent
```

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.
The removed `kotlinDslPluginOptions.jvmTarget` is replaced by selecting a Java toolchain in the build applying `kotlin-dsl`.

### Publications, assembly, and archive permissions

Configure a component before creating its publication: modifying Gradle Module Metadata after eagerly populating a publication from that component now fails.
Custom output artifacts that relied on implicit attachment to `assemble` need explicit task wiring.
For an existing `packageDocs` task:

```kotlin
tasks.named("assemble") {
    dependsOn("packageDocs")
}
```

Archive tasks use deterministic entry order and fixed timestamps and permissions.
Set executable permissions explicitly for packaged scripts that need them.
Call `useFileSystemPermissions()` in an archive task to preserve source permissions, or set `org.gradle.archives.use-file-system-permissions=true` for all archive tasks.

### Test task migration

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.
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`.

## Deprecations and upcoming behavior

Implicit property or method lookup through parent projects now warns, 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, set `AntlrTask.packageName`; it sets the generator package and adjusts the output directory.
Passing `-package` directly is deprecated and becomes an error in Gradle 10.0.0.
`ReportingExtension.file(String)` and the `JavaForkOptions.setAllJvmArgs(...)` overloads that replace the full JVM argument list are deprecated.
Use `ResolvedArtifactResult.getAttributes()` and `getCapabilities()` to read artifact metadata directly.
Gradle plans to deprecate `ResolvedArtifactResult.getVariant()` in a future release.

## Configuration Cache and isolation

Changing a `-P` property can reuse the Configuration Cache entry when its provider is read only during task execution.
A changed project property in `gradle.properties` can reuse the entry when unused during configuration; execution-time provider reads see the updated value.
Properties supplied via `-Dorg.gradle.project.<name>=<value>` or `ORG_GRADLE_PROJECT_<name>` can also reuse the entry if configuration never reads them.
Execution-time `providers.gradleProperty(...)` reads get the current value even if the source switches between a system property and an environment variable.
Direct configuration-time reads of `gradle.startParameter.projectProperties` are tracked; changing an accessed `-P` value can invalidate the entry.

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
```

An execution-time Configuration Cache problem aborts the task immediately and prevents Gradle from marking it up to date or caching its outputs.
In warning mode, tasks marked as incompatible prevent reuse of the entry.
For serialization or loading failures, enable `org.gradle.configuration-cache.integrity-check=true`. Integrity checks can identify the task field and codec involved and increase cache size and read/write time.

Enable incubating Isolated Projects with `--isolated-projects` or `org.gradle.isolated-projects=true` in a Configuration Cache-compatible build.
Accessing mutable state such as `project(":other").tasks` or `gradle.extensions` fails by default.
The legacy `org.gradle.unsafe.isolated-projects` property names are deprecated aliases.

```properties
org.gradle.isolated-projects=true
# Discover violations while preserving isolation guarantees.
org.gradle.isolated-projects.diagnostics=true
# For migration experiments, treat violations as warnings.
# org.gradle.isolated-projects.dangerously-ignore-problems=true
```

Use a `Property<ResolutionResult>` as a task input with the Configuration Cache to analyze `allComponents` and `allDependencies` without downloading artifacts.
Third-party agents attached at JVM startup are supported in ordinary daemon builds and TestKit's default daemon mode.
For TestKit debugging with an agent, use `-Dorg.gradle.debug=true` and attach the debugger to the daemon.

## Lazy configuration and publication

Applying `base`, including through Java or Kotlin plugins, no longer eagerly realizes configurations declared with `register` or incubating role-based factories such as `resolvable`.
Put setup for a registered configuration in its configuration action.
Pass a configuration provider directly to `extendsFrom` to establish inheritance without immediately realizing the parent.

`target.addAllLater(source)` reads attributes lazily: source values override earlier target values for matching keys, and a later target assignment takes precedence.
`DomainObjectCollection.disallowChanges()` prevents additions and removals while pending elements stay lazy and individual elements remain configurable.
Wiring `DomainObjectCollection.getElements()` into a task input carries through producer task dependencies from providers registered with `addLater` or `addAllLater`.

`AdhocComponentWithVariants.addVariantsFromConfiguration` and `withVariantsFromConfiguration` accept `Provider<ConsumableConfiguration>`.
Pass the provider from `configurations.consumable` directly so the configuration stays unrealized until publishing needs it.
The strongly typed `org.gradle.api.artifacts.dsl.Dependencies` API is partially stable; version catalog dependency support remains subject to change.

## Daemon, Wrapper, and command line

With a toolchain resolver configured in `settings.gradle.kts`, `updateDaemonJvm` records per-platform `toolchainUrl.<OS>.<ARCH>` entries in `gradle/gradle-daemon-jvm.properties`.
Gradle uses those URLs to download a daemon JDK when no local installation matches the criteria.
Set `nativeImageCapable` to require a JDK with GraalVM Native Image support; daemon toolchain selection also supports this criterion.
Use `--info` to see requested and actual JVM contexts when Gradle rejects an incompatible daemon.

Run the `wrapper` task with Gradle 9.0.0 or later to resolve a partial version to the latest release on that line.
Starting with Gradle 9.9, the task preserves existing Wrapper settings when updating the Gradle version.
Download retries are disabled by default; set `retries` and `retryBackOffMs` in `gradle/wrapper/gradle-wrapper.properties` to configure the maximum retry attempts and initial delay in milliseconds.
The delay doubles on successive failures.

| Need | Command or setting |
| --- | --- |
| Print the dependency tree and skip task execution | `./gradlew build --task-graph` |
| See a task's registration source | `./gradlew help --task assemble` |
| Include registration sources in the task list | `./gradlew tasks --provenance` |
| Disable interactive prompts for one invocation | `./gradlew build --non-interactive` |
| Disable interactive prompts for builds using a properties file | `org.gradle.console.interactive=false` in `gradle.properties` |
| Suppress console colors while retaining other styling and rich features | Set `NO_COLOR` to any non-empty value |
| Initialize a project in a target directory, creating it if needed | `gradle init --type java-application --into my-new-project` |

## Tests, reports, and diagnostics

Set `Test.testDefinitionDirs` to let a JUnit Platform engine discover definitions even when the task has no test classes.
Gradle 9.9 can filter JUnit Platform tests with no backing test method.
For TestNG, `threadPoolFactoryClass` must implement `org.testng.IExecutorServiceFactory` on 7.10 or later and `org.testng.thread.IExecutorFactory` on 7.0 through 7.9.

Gradle captures JUnit Platform `TestReporter.publishEntry` and `publishFile` data, including construction, setup, and teardown, in the HTML report's Data and Attachments tabs.
JUnit XML stores entries in `<properties>` and file references as `[[ATTACHMENT|/path/to/file]]`.
JUnit XML `<testsuite>` timestamps include fractional seconds to millisecond precision; parsers that assumed whole-second timestamps need to accept the fractional part.

TestNG, JUnit 4, and JUnit Platform startup failures bypass the test logging granularity filter and surface by default, subject to the `testLogging.events` filter for `FAILED` events.
Tooling API clients can identify these through `TestFailureDetails.isFrameworkFailure()`.

Use `--warning-mode=all` to show relevant Problems API entries alongside the HTML report link.
Gradle captures full traces for the first 50 problems and source locations for up to 2,000 more by default; `--warning-mode=all` captures a location for every problem, with shortened traces after the first 50.
Set `org.gradle.warning.mode=none` to omit the Problems report link; the report is still generated.

## Tooling and plugin authoring

Attach typed problem payloads with `ProblemSpec.additionalData(Data.class, action)` and an interface extending `org.gradle.api.problems.AdditionalData`.
Clients use `CustomAdditionalData.get(View.class)` with matching getters; a build-side `Property<String>` is exposed as a `String`, and nested payloads can use nested view types.
The incubating `BuildController.fetch(...)` can deliver available tooling models with structured failures before reporting a failing sync operation as failed.

`org.gradle.tooling.parallel` controls Tooling API actions such as IDE sync independently of task execution; when unset, it takes the value of `org.gradle.parallel`.
Enable native access at startup in the JVM hosting a Tooling API client running on Java 24; the client uses JNI.

Plugin projects using `com.gradle.plugin-publish`, `ivy-publish`, or `maven-publish` enable stricter validation by default, including missing task input annotation checks.
An `@Optional` property also needs an input or output annotation, or `@Internal` if Gradle should ignore it; combining `@Internal` and `@Optional` is an error, so remove `@Optional` from such properties.
Use `layout.settingsDirectory.file("version.txt")` from any project to resolve a shared file beside `settings.gradle(.kts)`.

Files in this skill

  • SKILL.md10 KB
  • coverage.json1.3 KB
  • references/configuration-cache-and-laziness.md7 KB
  • references/daemon-cli-and-platforms.md6.5 KB
  • references/dependencies-publishing-and-distribution.md7.7 KB
  • references/gradle-9-upgrade.md9.1 KB
  • references/testing-and-quality.md8 KB
  • references/tooling-problems-and-build-logic.md7.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.