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.
- Go to Help->”Install New Software”.
- On ->”Install New Software” screen click on “available software sites”.
- It will pop up list of download sites, on top is the default for eclipse version say for indigo it’s Juno – http://download.eclipse.org/releases/juno . Select it and click ok.
- In drop down associated with “Work with”, the selected link will appear. Click to select the download.
- This will show all updates available from the link.
- Type maven in the filter box, select the option under collaboration.
- Click next and follow screen instructions. It’s DONE
- Where can I get a sample maven project to get started?
- 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.
- Clicking on next will ask to select an artifact ID.
- Next Screen will ask for Group Version and ID
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.
Click Ctrl+N to open new dialog box. Select “Maven project” under “Maven” section
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
This will create the required project. Take a look at the POM.xml, it already contains all the dependencies for the Spring MVC project.
Posted on November 1, 2012, in Build and integration and tagged eclipse, maven. Bookmark the permalink. 1 Comment.
Pingback: Maven -basic concept, set up in eclipse and first project « Thoughts on Software design and development