How to create simple java project using maven in eclipse

In this post, we will see how to create a simple java project using maven in eclipse. We have already seen before how to create dynamic web project using maven in eclipse.

I am using following tools for this post.
  • eclipse-jee-mars-R-macosx-cocoa-x86_64
  • Apache tomcat 8
  • m2eclipse plugin
  • jdk 1.7

Steps for creating dynamic web project using maven in eclipse.


1) Install m2eclipse for maven plugin in eclipse. Please follow this link for installing m2eclipse plugin in eclipse.

2) goto new -> project-> Maven Project and click on next

3) You will see below screen , again click on next

4) We need to put group id and artifact id here.

Let me tell you more about group id and artifact id.

Group id : It uniquely identifies your project among all. So it may be something like com.companyname

Artifact id : It is name of jar or war without version. it may be something like project, so here we have put artifact id as SimpleJavaProjectUsingMaven

Version : Version is used for version control for artifact id. If you distribute this project, you may incrementally create different version of it.

If we have any dependency on any parent project, we can declare it in Parent project.
New Maven Java Project

5) Click on finish , you will see  project structure as below

Bingo !! we are done with simple java project using maven in eclipse.

Please comment if you are facing any issue with this.

Written by Arpit:

If you have read the post and liked it. Please connect with me on Facebook | Twitter | Google Plus

 

Java tutorial for beginners Copyright © 2012