Search code examples
javaeclipsemavengradlegradle-kotlin-dsl

Convert Gradle-Kotlin build to Maven?


I need to use a maven build for my project rather than Gradle using Eclipse.

Below is the source code that I will be using: https://github.com/mongodb/mongo-kafka

There are ways to generate pom.xml files using Gradle build (https://www.baeldung.com/gradle-build-to-maven-pom). However, I realized *.kts extension is related to Kotlin DSL rather than groovy. I have used neither of them before.

Is there any possible way to convert this to pom.xml file which can be used for Maven build?


Solution

  • You can't do it automatically if that is what you are asking. While the dependencies section can be converted one to one, the plugins and tasks are gradle specific. You will need to find a matching maven plugin for each one to fulfill the task currently done by the gradle plugins. A better question would be why bother converting? Gradle is perfectly fine to use and eclipse's maven support is historically terrible.