Gradle-mcp managing_gradle_dependencies
install
source · Clone the upstream repo
git clone https://github.com/rnett/gradle-mcp
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/rnett/gradle-mcp "$T" && mkdir -p ~/.claude/skills && cp -r "$T/src/main/skills/managing_gradle_dependencies" ~/.claude/skills/rnett-gradle-mcp-managing-gradle-dependencies && rm -rf "$T"
manifest:
src/main/skills/managing_gradle_dependencies/SKILL.mdsource content
Authoritative Dependency Intelligence & Maven Central Search
Audits project dependencies, performs high-resolution update checks, and discovers new libraries on Maven Central with powerful, integrated search tools.
Constitution
- ALWAYS use
for querying project dependency information instead of raw Gradle tasks.inspect_dependencies - ALWAYS provide absolute paths for
.projectRoot - ALWAYS use
to quickly identify available library updates.updatesOnly: true - ALWAYS use
to find exact GAV coordinates for new libraries.lookup_maven_versions - NEVER add a dependency to a project without verifying its authoritative version and existence on Maven Central.
- ALWAYS use the
argument to target specific modules in multi-project builds.projectPath
Directives
- Identify authoritative paths: ALWAYS use the Gradle project path (e.g.,
) when querying dependencies.:app - Inspect plugins and build scripts: Build script dependencies (like plugins) are automatically included in
output under configurations prefixed withinspect_dependencies
(e.g.buildscript:
).buildscript:classpath - Monitor for updates: ALWAYS use
inupdatesOnly: true
to retrieve a flat, high-signal report of available library updates:inspect_dependencies
with the project paths where each dep is used. Configuration and source-set detail is intentionally omitted; usegroup:artifact: current → latest
with a specificinspect_dependencies
filter if that detail is needed.dependency - Target dependencies surgically: Use the
parameter independency
to target a single library. It supportsinspect_dependencies
,group:name:version:variant
,group:name:version
, or justgroup:name
. This is significantly faster than resolving the entire project graph.group - Efficient Transitive Isolation: When isolating a single library, filter the flattened list of resolved components using the dependency filter rather than traversing the dependency graph. This naturally and efficiently excludes transitive dependencies that do not match the targeted filter.
- Discover libraries surgically: ALWAYS use
to check the version history of an existing artifact.lookup_maven_versions - Use
for diagnostics: For built-in tasks likegradle
, ALWAYS use thedependencyInsight
tool withgradle
.captureTaskOutput - Audit full trees: ALWAYS use
inonlyDirect: false
when you need to visualize the complete transitive dependency graph.inspect_dependencies
When to Use
- Dependency Tree Auditing: When you need to visualize the full dependency graph for a specific project, configuration, or source set.
- Automated Update Detection: When performing maintenance and you want a concise report on available stable or pre-release updates.
- Precision Artifact Discovery: When looking for new libraries on Maven Central and you need to find exact GAV coordinates or explore an artifact's full version history.
- Version Conflict Resolution: When you need to identify why a specific version of a library is being resolved and look for compatible alternatives.
- Targeted Audit: When you only care about a specific library and want to bypass the cost of a full project resolution.
Workflows
1. Auditing Dependencies
- Identify the project module (e.g.,
).:app - Call
.inspect_dependencies(projectPath=":app") - Optionally filter by
(e.g.,configuration
) orruntimeClasspath
(e.g.,sourceSet
).test
2. Checking for Stable Updates
- Call
.inspect_dependencies(updatesOnly=true, stableOnly=true) - Review the flat list of upgradeable dependencies. Each entry shows
and the project paths where it is used.group:artifact: current → latest
3. Discovering New Libraries
- Use
to see all available versions for a specific library.lookup_maven_versions(coordinates="group:artifact")
4. Targeted Dependency Inspection
- Identify the dependency you want to check (e.g.,
).org.mongodb:mongodb-driver-sync - Call
.inspect_dependencies(dependency="org.mongodb:mongodb-driver-sync") - The report will be focused ONLY on that library across all matched configurations.
Examples
List dependencies for a specific module
{ "projectPath": ":app" } // Reasoning: Auditing the direct and transitive dependencies of the 'app' module to understand its runtime footprint.
Check for updates for a specific library
{ "dependency": "org.jetbrains.kotlinx:kotlinx-coroutines-core", "updatesOnly": true } // Reasoning: Surgically checking if a specific library has available updates.
Check for stable updates across the project
{ "updatesOnly": true, "stableOnly": true } // Reasoning: Performing a high-signal update audit that ignores unstable pre-release versions.
List all versions of a specific library
{ "coordinates": "org.jetbrains.kotlinx:kotlinx-serialization-json" } // Reasoning: Retrieving the full version history of an artifact to identify the latest stable or specific version required.
Troubleshooting
- Dependency Not Found: Verify the
using theprojectPath
task in theprojects
skill.introspecting_gradle_projects - Update Not Showing: If a known update is missing, ensure
is set correctly and check if astableOnly
is active.versionFilter - [UPDATE CHECK SKIPPED]: This annotation means the dep was in scope for update checking but its resolution genuinely failed — it does NOT appear for dependencies intentionally excluded from the update-check scope (e.g., transitive deps
when
, or deps excluded by aonlyDirect=true
filter).dependency - Maven Search No Results: Use broader search terms or verify the
format for version searches.group:artifact - Missing environment variables: Set
if Gradle cannot find expected env vars (e.g.,invocationArguments: { envSource: "SHELL" }
).JAVA_HOME