Adding maven plugin to eclipse and setting up first project

In my previous post I wrote about basic maven concepts for a beginner. In this post I will try to out line how to install maven for eclipse and creating a maven project in eclipse.

  1. Go to Help->”Install New Software”.
  2. On ->”Install New Software” screen click on “available software sites”.
  3. It will pop up list of download sites, on top is the default for eclipse version say for indigo it’s Juno – . Select it and click ok.
  4. In drop down associated with “Work with”, the selected link will appear. Click to select the download.
  5. This will show all updates available from the link.
  6. Type maven in the filter box, select the option under collaboration.
  7. Click next and follow screen instructions. It’s DONE
  8. It will need a restart of eclipse. To confirm whether eclipse plugin was success fully installed or not open windows->preferences->Java->BuildPath->Classpath Variables. A variable named M2_REPO must appear. This is the location where all the downloaded dependencies will appear.

  9. Where can I get a sample maven project to get started?
  10. Click Ctrl+N to open new dialog box. Select “Maven project” under “Maven” section

  11. Select a project folder. If it does not exist, maven will create one. DO NOT select the workspace folder only, other wise all files will be directly generated there instead inside a project specific folder.
  12. Clicking on next will ask to select an artifact ID.
  13. In simple terms artifactId represent a type of project to be generated for example skeleton for a simple Java project, A j2ee project, spring MVC project etc. Selecting an artifact ID will generate folder structure for the project along with the POM file which will have all the dependencies defined for that type of project. I have selected Spring MVC

  14. Next Screen will ask for Group Version and ID

  15. This will create the required project. Take a look at the POM.xml, it already contains all the dependencies for the Spring MVC project.

About ChandanPandey

Try to come up with a good design as by product of good coding practices

Posted on November 1, 2012, in Build and integration and tagged , . Bookmark the permalink. 1 Comment.

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

%d bloggers like this: