clankerguru/opsx/gradle-plugins-basics
Claude Code and agent skill by clankerguru/opsx
- community
- ext:[{"type":"plugin","description":"Custom plugin integration"}]
Checking that the SKILL.md file is still in the repository.
Applying Gradle plugins — plugins{} DSL, pluginManagement, resolution, core plugin catalog, settings vs project plugins.
Install
npx vskill@latest install clankerguru/opsx/gradle-plugins-basicsSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as clankerguru/opsx/gradle-plugins-basics.
Gradle Plugins — Basics
Plugins are how Gradle grows. The core distribution ships a small kernel; everything else — Java, Kotlin, Android, publishing, Spring Boot — arrives as a plugin. This skill covers applying plugins. Writing them is /gradle-custom-plugins.
Source of truth:
- https://docs.gradle.org/current/userguide/plugins.html
- https://docs.gradle.org/current/userguide/plugin_reference.html
- https://docs.gradle.org/current/userguide/custom_plugins.html
- https://plugins.gradle.org
1. The plugins {} block
The canonical way to apply plugins. Runs before the rest of the script — it resolves the plugin, adds it to the classpath, and applies it.
Three forms:
- `
java-library` — core plugin via Kotlin-DSL accessor. Core plugins take no version. kotlin("jvm")— typed accessor exposed by the Gradle Kotlin DSL for well-known plugins.id("...") version "..."— string ID, required for third-party plugins.
Rules
- Must be the first block in the script (only
buildscript {}may precede it). - No conditional logic —
if (...) plugins { ... }does not work. - No variables — the block is evaluated in an isolated context.
- Version may be omitted if declared in
settings.gradle.ktspluginManagement.
apply false
Used in the root build of a multi-module project. Resolves the plugin (pins its version) without applying it to this project — subprojects can then apply it by ID without repeating the version.
2. pluginManagement in settings
settings.gradle.kts is where you centralise plugin resolution:
Precedence for a plugin declared id("foo") without version:
pluginManagement.plugins { }mapping in settings.- Included build (composite build) exposing a plugin by that ID.
gradlePluginPortal()/ declared repositories.
3. Version catalogs and plugins
If you use a version catalog (gradle/libs.versions.toml), plugins can be declared there:
Catalogs are the recommended way to share plugin versions across a multi-module project.
4. Legacy buildscript {}
Still valid; required for plugins that don't publish markers to the plugin portal.
Disadvantages: no plugin markers, no apply false, harder to share across subprojects, does not work with the plugins {} DSL.
Use only when the plugin author hasn't published a plugin marker.
5. Script plugins
Apply a local script as a plugin. Small, no-version-needed snippets.
Script plugins are legacy. Prefer precompiled script plugins in build-logic (see /gradle-custom-plugins).
6. Core plugin catalog
Core plugins ship with Gradle — no repository, no version. Group them by purpose:
JVM languages
| ID | Purpose | |
|---|---|---|
java | Base Java support (superseded by java-library for libraries) | |
java-library | Library with api/implementation split | |
application | Runnable JVM app, adds run/installDist/distZip | |
java-platform | BOM-style platform of dependency constraints | |
groovy | Groovy sources | |
scala | Scala sources | |
antlr | ANTLR grammars |
Packaging & publishing
| ID | Purpose | |
|---|---|---|
distribution | Generic zip/tar distributions | |
maven-publish | Publish to Maven repositories | |
ivy-publish | Publish to Ivy repositories | |
signing | PGP signing of publications |
Native
| ID | Purpose | |
|---|---|---|
cpp-application | C++ executable | |
cpp-library | C++ library | |
cpp-unit-test | C++ tests | |
swift-application | Swift executable | |
swift-library | Swift library | |
xctest | Swift tests via XCTest |
Code quality
| ID | Purpose | |
|---|---|---|
checkstyle | Checkstyle rules on Java | |
pmd | PMD analysis | |
codenarc | CodeNarc for Groovy | |
jacoco | JaCoCo code coverage |
IDE integration
| ID | Purpose | |
|---|---|---|
idea | Generate IntelliJ files | |
eclipse | Generate Eclipse files | |
eclipse-wtp | Eclipse WTP files | |
visual-studio | Visual Studio files | |
xcode | Xcode project files |
Utility
| ID | Purpose | |
|---|---|---|
base | Adds clean, assemble, build lifecycles | |
build-init | gradle init for scaffolding | |
wrapper | gradle wrapper to generate the wrapper | |
project-report | projectReport, dependencyReport tasks | |
help-tasks | help, tasks, properties, dependencies | |
version-catalog | Publish a libs.versions.toml |
Meta
| ID | Purpose | |
|---|---|---|
java-gradle-plugin | Building a Gradle plugin in Java/Kotlin | |
groovy-gradle-plugin | Gradle plugin in Groovy | |
kotlin-dsl | Precompiled script plugins in Kotlin | |
kotlin-dsl-precompiled-script-plugins | (internal) |
Full reference: https://docs.gradle.org/current/userguide/plugin_reference.html
7. Settings plugins vs project plugins
A plugin targets either Settings or Project.
Settings plugins apply before any project is configured — use them for:
- Develocity / build scans
- Toolchain resolution
- Included builds / composite
- Dependency resolution management (
dependencyResolutionManagement)
Project plugins (the common case) apply inside a build.gradle.kts.
A plugin written to target Settings cannot be applied in a project script — the ID is the same, the target type differs. Check the plugin docs.
8. Inspecting what's applied
9. Applying a plugin programmatically
Inside a custom plugin or convention script, avoid string IDs:
pluginManager.apply is idempotent — applying twice is a no-op.
10. Anti-patterns
- Mixing
buildscript {}andplugins {}for the same plugin — pick one. - Re-declaring a plugin version in every subproject — declare in the root with
apply falseor inpluginManagement.plugins. apply(plugin = "...")on a plugin that's already applied viaplugins {}— redundant.- Putting
pluginManagementin the root build script — it only belongs insettings.gradle.kts. - Depending on plugin order within
plugins {}— Gradle doesn't guarantee it. If one plugin must see another's model, usepluginManager.withPlugin("...") { ... }:
This fires whenever that plugin applies — now or later — and is the correct idiom for cross-plugin configuration.
11. Sub-skill cross-reference
- Writing a plugin →
/gradle-custom-plugins - Settings-plugin patterns used in this project →
/gradle-settings-plugin - Convention plugins /
build-logiclayout →/gradle-build-conventions - Tasks registered by plugins →
/gradle-tasks
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingcli/src/main/resources/content/skills/gradle-plugins-basics/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
pluginCustom plugin integration
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/clankerguru/opsx/gradle-plugins-basics)