Create new Maven project in Eclipse

In this tutorial, I will show you the way to create new Maven project in Eclipse.

First of all, you need to open your Eclipse IDE then go to File, select New and then select Maven Project:

Create new Maven project in Eclipse

Here, we have two options to create a Maven project, using Maven Archetype or not? Maven Archetype, it’s like a template, which helps us to create Maven projects with structures that include files and directories. If you want to use Maven Archetype, you can leave the checkbox “Create a simple project (skip archetype selection)” blank by default, otherwise, check this checkbox. Then, a Maven project with the pom.xml file will be created.

I would choose “Create a simple project (skip archetype selection)” and click the Next button.

Create new Maven project in Eclipse

In this dialog, you should enter the Group Id and the Artifact Id. Other fields are optional, you can use them if necessary or leave it by default.

Create new Maven project in Eclipse

Click Finish button to complete creating new Maven project in Eclipse.

By default, this project will use Java Runtime Environment version 1.5. You can change it, depending on which version of Java you are installing on your machine, using the Maven Compiler Plugin in the pom.xml file as follows:

Result:

Create new Maven project in Eclipse

Đánh giá bài viết
Chia sẽ bài viết này ...Share on Facebook
Facebook
0Tweet about this on Twitter
Twitter
Share on LinkedIn
Linkedin

Add Comment