BackendBench
Coffee
Free tool

Maven โ‡„ Gradle dependency converter

Paste a <dependencies> block or Gradle dependencies { } lines and get the other format, with scopes and BOMs mapped correctly.

Gradle

Moving a build between Maven and Gradle

Teams switch build tools for speed, for incremental builds, or because a new project template uses the other one. The dependency list is the easiest part to move and the part you do most often when you copy a snippet from a README: the Maven Central page shows both a pom.xml tag and a Gradle line, and your project uses only one of them.

This converter reads a block of dependencies and rewrites it. The scope mapping is the important bit. A Maven provided dependency, such as Lombok or the Servlet API, is needed to compile but is supplied at runtime, so Gradle calls it compileOnly. A runtime dependency, such as a JDBC driver, is not needed to compile, so it becomes runtimeOnly. Getting this wrong still builds, but it bloats the compile classpath or fails at startup.

What it keeps

What it warns about

Maven properties such as ${spring.version} do not exist in Gradle, so they are flagged for you to move into gradle.properties. Optional dependencies, system-scope dependencies, annotation processors and version-catalog references (libs.guava) cannot be converted exactly, and the tool says so instead of guessing. Everything runs in your browser, so a private pom.xml is never uploaded.

Frequently asked questions

How do Maven scopes map to Gradle configurations?

compile becomes implementation, runtime becomes runtimeOnly, provided becomes compileOnly and test becomes testImplementation. Gradle also has api for libraries that expose a dependency in their public API, which Maven cannot express.

What happens to a Maven BOM import?

A dependencyManagement entry with scope import and type pom becomes implementation platform("group:artifact:version") in Gradle, and the other way round. Spring Boot projects often use this instead of the parent POM.

Why do some dependencies have no version?

The version comes from a BOM, a parent POM or the Spring dependency-management plugin. Copy the platform or parent as well, or the build will fail with a missing version.

Are plugins and repositories converted?

No. Only dependency blocks are converted, because plugin configuration differs too much to translate safely. Convert those by hand.

More tools you might need