问题描述
我们有一个使用Maven作为构建系统的大型项目。我们决定,在未来的项目中,我们将使用Gradle作为更方便的工具,但我们也希望将Gradle用于我们的遗留项目。
我认为从Maven迁移到Gradle有一段时间会非常痛苦,因为我们在POM文件中有很多代码(我们有非常繁重的构建逻辑)。
我知道,Gradle有自动迁移工具gradle init),但它不能正常工作(我认为这个工具适用于没有特定的构建逻辑的小型Maven项目)。
所以,这里有一个问题:can我包含Gradle模块到Maven项目以小步骤迁移?也许有Maven插件,它允许将 build.gradle
作为 pom.xml
文件?有一个,它允许你从Maven内部运行Gradle任务。从插件描述中可以看到:
不确定,如何将Gradle构建的构件包含到您的依赖项中,可能需要将此构件发布到本地Maven存储库,以使其可用于您的Maven项目。
We have large project that uses Maven as a build system. We decided that in future projects we will use Gradle as more convenient tool, but we want to use Gradle for our legacy project too.
I think that migrating from Maven to Gradle at one time will be very painful, because we have TONS of code in POM files (we have really heavy build logic).
I know, that Gradle have automigration tool (gradle init) but it doesn't work properly (I think this tool is for small Maven projects with no specific build logic).
So, here is a question: can I include Gradle module to Maven project to migrate with small steps? Maybe there is Maven plugin, that allows to treat build.gradle
as pom.xml
file?
There is a gradle-maven-plugin which allows you to run Gradle tasks from within Maven. From the plugin description:
Not sure, how to include artifacts of Gradle build to your dependencies, may be you'll need to post this artifact to local maven repository, to make it available for your maven project.
这篇关于将Gradle模块包含到Maven项目中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!