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
Over 2 million developers have joined DZone.
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

  • How to Save Money Using Custom LLMs for Specific Tasks
  • Deployment Lessons You Only Learn the Hard Way
  • Alternative Structured Concurrency
  • The Agentic Agile Office: Streamlining Enterprise Agile With Autonomous AI Agents
  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 user avatar
A N M Bazlur Rahman
DZone Core CORE ·
Dec. 18, 16 · Tutorial
Likes (18)
Comment
Save
Tweet
Share
214.3K Views

Join the DZone community and get the full member experience.

Join For Free

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

The likes didn't load as expected. Please refresh the page and try again.

  • 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