Convert existing java project to Maven in eclipse

Hi java Folks,

Today, we will discuss how we can convert an existing Java project to Maven in eclipse.

To use eclipse utility of converting an existing java project to maven there should be maven installed in eclipse. If maven is not installed in eclipse then you need to install maven in eclipse. To do so following are the steps:

By this, maven will be installed in eclipse.

Now, right click on the project which you want to convert to Maven and click “Configure” and then “Convert to maven project“.


It will show following dialog.


Group Id, Artifact Id and version can be set as default. Add value for “Name” and “Description“. These options are optional. Click on “Finish“.

It will convert java project to maven and will create following pom.xml file.

<project xmlns="" xmlns:xsi="" xsi:schemaLocation="">

Here sourceDirectory element describes the source directory of java.

In pom.xml, there is no any dependency by default so we have to add project dependencies manually by adding following element inside the “project” element.

Add all the dependencies here...

This is all about how to convert an existing java project to maven.

Leave a Reply

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

You are commenting using your 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