mcpField
J
java-gradle

java-gradle

github.com/pluginagentmarketplaceDevelopment41382 installsUpdated 42w ago
Repository

About java-gradle

A skill for configuring Gradle builds for Java projects with Kotlin DSL, aimed at developers managing dependencies and build performance. It covers catalogs, caching, custom tasks, and CI/CD setup.

Key features

  1. 01Kotlin DSL build configuration
  2. 02Dependency catalogs and constraints
  3. 03Build cache optimization
  4. 04Custom task configuration
  5. 05CI/CD integration

Use cases

  1. 01Set up a Java project build
  2. 02Organize dependency versions
  3. 03Investigate dependency conflicts
  4. 04Reduce build times with caching

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pluginagentmarketplace/custom-plugin-java --skill java-gradle

After installing, type/java-gradlein Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

assets/
build.gradle.kts
config.yaml
schema.json
references/
GUIDE.md
PATTERNS.md
scripts/
validate.py

Details

From the project README

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

ProblemSolution
Slow buildsEnable --build-cache
Version conflictUse platform() or constraints
Cache issuesgradle --refresh-dependencies

Usage

Skill("java-gradle")

Comments

Markdown supported