Gradle DSL preference
Java Gradle Skill
Master Gradle build tool with Kotlin DSL for Java projects.
Overview
This skill covers Gradle configuration with Kotlin DSL including task configuration, dependency management with catalogs, build cache optimization, and CI/CD integration.
When to Use This Skill
Use when you need to:
- Configure Gradle builds (Kotlin DSL)
- Manage dependencies with catalogs
- Optimize build performance
- Set up build cache
- Create custom tasks
Quick Reference
// build.gradle.kts
plugins {
java
id("org.springframework.boot") version "3.2.1"
id("io.spring.dependency-management") version "1.1.4"
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
repositories {
mavenCentral()
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-web")
testImplementation("org.springframework.boot:spring-boot-starter-test")
}
tasks.withType<JavaCompile> {
options.compilerArgs.addAll(listOf("-parameters", "-Xlint:all"))
options.isFork = true
options.isIncremental = true
}
tasks.test {
useJUnitPlatform()
maxParallelForks = Runtime.getRuntime().availableProcessors() / 2
}
Version Catalog
# gradle/libs.versions.toml
[versions]
spring-boot = "3.2.1"
[libraries]
spring-boot-web = { module = "org.springframework.boot:spring-boot-starter-web", version.ref = "spring-boot" }
[plugins]
spring-boot = { id = "org.springframework.boot", version.ref = "spring-boot" }
Useful Commands
gradle dependencies # View dependencies
gradle dependencyInsight --dependency log4j # Analyze dep
gradle build --scan # Build scan
gradle build --build-cache # Use cache
gradle wrapper --gradle-version 8.5 # Update wrapper
Build Optimization
// settings.gradle.kts
enableFeaturePreview("STABLE_CONFIGURATION_CACHE")
// Enable parallel and caching
org.gradle.parallel=true
org.gradle.caching=true
Troubleshooting
| Problem | Solution |
|---|---|
| Slow builds | Enable --build-cache |
| Version conflict | Use platform() or constraints |
| Cache issues | gradle --refresh-dependencies |
Usage
Skill("java-gradle")
You Might Also Like
Related Skills

create-pr
Creates GitHub pull requests with properly formatted titles that pass the check-pr-title CI validation. Use when creating PRs, submitting changes for review, or when the user says /pr or asks to create a pull request.
n8n-io
electron-chromium-upgrade
Guide for performing Chromium version upgrades in the Electron project. Use when working on the roller/chromium/main branch to fix patch conflicts during `e sync --3`. Covers the patch application workflow, conflict resolution, analyzing upstream Chromium changes, and proper commit formatting for patch fixes.
electron
pr-creator
Use this skill when asked to create a pull request (PR). It ensures all PRs follow the repository's established templates and standards.
google-gemini
clawdhub
Use the ClawdHub CLI to search, install, update, and publish agent skills from clawdhub.com. Use when you need to fetch new skills on the fly, sync installed skills to latest or a specific version, or publish new/updated skill folders with the npm-installed clawdhub CLI.
moltbot
tmux
Remote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.
moltbot
create-pull-request
Create a GitHub pull request following project conventions. Use when the user asks to create a PR, submit changes for review, or open a pull request. Handles commit analysis, branch management, and PR creation using the gh CLI tool.
cline