Maven and Gradle Dependencies Compared

There is no exact match between dependencies in Maven and Gradle, however here’s a rough mapping:

GradleMaven
compilecompile
implementationcompile
apicompile
testCompiletest
testImplementationtest
testRuntimetest
testRuntimeOnlytest
compileOnlyprovided
testCompileOnlyprovided
runtimeOnlyruntime

You can auto-convert your dependencies from Gradle to Maven here:

https://gradle2maven.stackblitz.io/

 

Leave a comment

Your email address will not be published.