DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • How To Add Three Photo Filters to Your Applications in Java
  • How To Convert HTML to PNG in Java
  • How To Convert Image Files Into GIF or WebP Format Using Java
  • How to Convert a PDF to Text (TXT) Using Java

Trending

  • Genkit Flows as senro Steps: Extremely Powerful AI Pipelines in Go
  • Closing the Drift Loop: An AI Agent That Drafts Terraform Fixes
  • The Permission Was Valid. The Action Was Not Authorized.
  • Why Kotlin or Java Is the Wrong Question For Enterprises

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Coding
  3. Java
  4. How to Convert Maven to Gradle and Vice Versa

How to Convert Maven to Gradle and Vice Versa

Converting Maven to Gradle only takes one step, and converting Gradle back to Maven isn't much more difficult.

By 
A N M Bazlur Rahman
DZone Core CORE ·
Dec. 18, 16 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
214.8K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

To convert Maven to Gradle, the only step is to run gradle init  in the directory containing the POM. This will convert the Maven build to a Gradle build, generating a settings.gradle file and one or more build.gradle files. 

That's all!

To convert Gradle to Maven, first, Maven plugin need to be added in the build.gradle file. 

build.gradle should look like this: 

apply plugin: 'java'
apply plugin: 'maven'
 
group = 'com.bazlur.app'
// artifactId is taken by default, from folder name
version = '0.1-SNAPSHOT'
 
dependencies {
compile 'commons-lang:commons-lang:2.3'
}

Then, simply run Gradle install in the directory.

Lastly, simply run gradle install and the directory containing build.gradle will do the job. It will create pom-default.xml in the build/poms subfolder.

Apache Maven Gradle Convert (command)

Opinions expressed by DZone contributors are their own.

Related

  • How To Add Three Photo Filters to Your Applications in Java
  • How To Convert HTML to PNG in Java
  • How To Convert Image Files Into GIF or WebP Format Using Java
  • How to Convert a PDF to Text (TXT) Using Java

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook