Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert a Maven build to Gradle?

Tags:

maven

gradle

I know I should be working with my build.gradle and init.gradle files but I don't know what to write or how to point to my project folder with the pom.xml file.

like image 993
user3150054 Avatar asked Dec 31 '13 19:12

user3150054


People also ask

How do I convert a project to Gradle?

Create or open your Gradle project. In the Project tool window, right-click the project and from the context menu, select New | File. In the New File dialog, enter gradle. properties as a filename and click OK.

Can you mix Maven and Gradle?

Short answer: yes. There's no conflict between having two independent build scripts for the same project, one in Maven and one in Gradle.

Why is Gradle faster than Maven?

The biggest differences are Gradle's mechanisms for work avoidance and incrementality. The top 3 features that make Gradle much faster than Maven are: Incrementality — Gradle avoids work by tracking input and output of tasks and only running what is necessary, and only processing files that changed when possible.


1 Answers

The first step is to run gradle init in the directory containing the (master) POM. This will convert the Maven build to a Gradle build, generating a settings.gradle file and one or more build.gradle files. For simpler Maven builds, this is all you need to do. For more complex Maven builds, it may be necessary to manually add functionality on the Gradle side that couldn't be converted automatically.

https://guides.gradle.org/migrating-from-maven/

like image 86
Peter Niederwieser Avatar answered Sep 18 '22 17:09

Peter Niederwieser