将Gradle-Kotlin构建转换为Maven。

huangapple go评论78阅读模式
英文:

Convert Gradle-Kotlin build to Maven?

问题

以下是翻译好的部分:

我需要在Eclipse中使用Maven构建我的项目,而不是使用Gradle。

以下是我将要使用的源代码:
<https://github.com/mongodb/mongo-kafka>

有一些方法可以使用Gradle构建生成pom.xml文件(https://www.baeldung.com/gradle-build-to-maven-pom)。然而,我意识到*.kts扩展与Kotlin DSL相关,而不是Groovy。我以前都没有使用过它们。

有没有可能将这个转换为可以用于Maven构建的pom.xml文件呢?

英文:

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?

答案1

得分: 3

你无法自动完成这个操作,如果这是你所询问的。虽然依赖部分可以一对一转换,但插件和任务是针对 Gradle 的特定内容。你需要为每个插件找到相应的 Maven 插件,以执行目前由 Gradle 插件完成的任务。一个更好的问题是:为什么要费心进行转换呢?Gradle 完全可以使用,而且 Eclipse 对 Maven 的支持在历史上一直很差劲。

英文:

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.

huangapple
  • 本文由 发表于 2020年9月9日 08:32:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/63803204.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定