AI SummaryAutomates migration of Maven projects to Gradle with Kotlin DSL and version catalogs, supporting single/multi-module projects, Spring Boot, and optional dual-build mode. Ideal for teams modernizing their build infrastructure or transitioning to Gradle conventions.
Install
Copy this and paste it into Claude Code, Cursor, or any AI assistant:
I want to install the "maven-to-gradle" skill in my project. Please run this command in my terminal: # Install skill into the correct directory mkdir -p .claude/skills/maven-to-gradle && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/maven-to-gradle/SKILL.md "https://raw.githubusercontent.com/adityamparikh/maven-to-gradle/main/SKILL.md" Then restart Claude Code (or reload the window in Cursor) so the skill is picked up.
Description
Migrate Maven projects to Gradle Kotlin DSL (KTS) with version catalogs (libs.versions.toml). Handles single-module and multi-module projects, Spring Boot parent POM conversion, Maven profile equivalents, and plugin mapping. Use when the user wants to convert a Maven project (pom.xml) to Gradle, migrate from Maven to Gradle, generate build.gradle.kts from pom.xml, set up version catalogs, or convert Maven multi-module projects to Gradle conventions. Also triggered by requests to "switch to Gradle", "convert my build", or "modernize my build system". Supports dual-build overlay mode where Gradle is added alongside Maven without removing it — triggered by "add Gradle to my Maven project", "run both Maven and Gradle", "dual build", or "keep both build systems".
Maven to Gradle KTS Migration
Migrate Maven projects to Gradle Kotlin DSL with version catalogs, following Gradle conventions.
Migration Workflow
• Analyze the Maven project structure (single vs multi-module, Spring Boot, Kotlin) • Run the migration script to generate baseline Gradle files • Review and refine the generated output • Handle profiles and custom plugin configurations manually • Verify the build compiles and tests pass
Step 1: Analyze the Project
Before running the script, examine the Maven project: • Read the root pom.xml to identify: packaging type (jar/pom/war), parent POM, modules, profiles • For multi-module projects, check each child pom.xml for inter-module dependencies • Identify special plugins that need manual conversion (see references/plugin-mappings.md)
Step 2: Run the Migration Script
Two modes are available: Full migration (default) — generates Gradle files, suggests removing Maven after verification: `bash python3 scripts/migrate.py <path-to-maven-project> --dry-run ` Overlay / dual-build — adds Gradle alongside Maven so both build systems work: `bash python3 scripts/migrate.py <path-to-maven-project> --mode overlay --dry-run ` Overlay mode also appends Gradle entries to .gitignore and preserves all pom.xml files. The script generates: • gradle/libs.versions.toml — version catalog with all dependencies, BOMs, and plugins • settings.gradle.kts — project name and module includes • build.gradle.kts — root build file (and per-module for multi-module projects) • gradle.properties — daemon, parallel, caching settings Review --dry-run output first, then run without the flag to write files. The script handles: • Spring Boot starter-parent → spring-boot + dependency-management plugins • Maven scope → Gradle configuration mapping (compile→implementation, provided→compileOnly, etc.) • BOM imports → platform() dependencies • Annotation processors (Lombok, MapStruct, etc.) → annotationProcessor configuration • Dependency exclusions • Java toolchain from compiler plugin or properties • Kotlin detection and plugin setup
Discussion
Health Signals
My Fox Den
Community Rating
Sign in to rate this booster