Convert Maven Project to Gradle Project


Install Gradle into your machine, here are the Gradle installation steps: https://docs.gradle.org/current/userguide/installation.html#installation

After successful installation of Gradle, below command should work in your command prompt/terminal window.

> gradle -v

------------------------------------------------------------
Gradle <<gradle version>>
------------------------------------------------------------

Now navigate to the maven root project directory(where pom.xml exists) and execute the below command:

 > gradle init 

When you run the command, gradle basically pars the existing pom.xmls and generates the corresponding Gradle build scripts. Gradle will also create a settings script if you’re migrating a multi-project build.

The new Gradle build includes the following:

  • All the custom repositories that are specified in the POM
  • External and inter-project dependencies
  • The appropriate plugins to build the project

Once successful migration of the project, you can run the below command to build the gradle project.

> gradle build

This will run the tests and produce the required artifacts without any extra intervention on your part.

Note: If your project contains multiple modules in which each module have its own pom with dependencies, then you may need to run `gradle init` command in each directory where ever pom exists.

About

I born in Good cultural place called India. My family is traditional family. We fallow all Indian traditions.

Tagged with: , , , ,
Posted in Build Tools, Others

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 679 other followers

Calendar
November 2019
M T W T F S S
« Oct    
 123
45678910
11121314151617
18192021222324
252627282930  
Mallikarjun Gunda

This is Mallikarjun Gunda, I am working as a software professional. Blogging is my Passion. This blog contains the posts on Java related technologies and programming languages. I am happy to share my knowledge through the blogs.

Blog Stats
  • 321,748 hits
IndiBlogger
malliktalksjava.wordpress.c...
70/100