Deep Import of Maven Projects

summary: A deep import of Maven projects at runtime similar to what Gradle provides for Ant. status: Planned. code: planned

A deep Maven import that allows:

  • Import Maven builds at runtime. * Enhance Maven builds from Gradle (e.g. provide incremental builds). * Execute any build-in or custom Maven plugins that are part of the Maven build. * Provide a very high compatibility with Maven by using embedded Maven under the hood for executing the Maven goals.

Those two roadmap items will be implemented before:

it seems to me like there should be a way to translate a maven pom.xml into a build.gradle. is that something you are looking into as well? does that even make sense to do?

Yes we need this also. We have a huge project with about 250+ pom files.

It does make a lot of sense. There is already a maven2gradle project by Baruch Sadogursky which is doing a good job. See the readme page for features and limitations. This functionality to turn a pom into a Gradle script will move into core at one point.

There are various use cases why you want to integrate with Maven:

  • Fully migrate a project to Gradle (conversion) * Runtime import into Gradle to configure the Gradle build. Here Gradle would do the actions and we would just use the pom to configure things. You can use all the goodness of Gradle. Of course for custom Maven plugins we would still need Embedded Maven to execute them. * Maximum Maven compatibility (Runtime import) For example for legacy projects that you don’t want to touch any more but want to integrate into a larger Gradle build. In that case we would Maven to execute all things of the build (e.g. compile, test, …).