Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How to Create a java project with Maven in Eclipse IDE

In this tutorial, we will explain about, How to setup a Maven projects into eclipse IDE. Maven plugin has already integrated with latest eclipse IDE.

Prerequisits:
  1. Eclipse should be installed.
  2. jdk should be installed atleast jdk 1.6 or  jdk 1.6+.
  3. Install Maven plugin if not integrated with eclipse.
1. Navigate to File Menu. Click 'File' -> 'New' -> 'Other' -> 'Maven Project' and then click 'Next'.


2. Select location -> check box Use default work location then click 'next'



3. Select the maven-archetype-quickstart archetype from the list then click on 'next'. This is the classical Maven example archetype for project creation. it will create a simple Maven web structure that will help get you started.

4. Enter the Group Id, Artifact Id and Version number will be by default 0.0.1-SNAPSHOTc and click 'Finish'

Now you have Created maven project successfully. Lets see how the project structure is created


If you observe, it has downloaded Maven Dependencies. You can see by expanding the Maven Dependencies. And also it has created pom.xml file. The below is the pom.xml file which got created automaticaly by Maven.

By default, it has added junit dependency, it will add the dependencies based on the 'Archetype' we select.

Run the build

Validate that the generate setup works correctly by running the build. For this right-click the pom.xml file and select Run As ▸ Maven build.

This opens a dialog which allows to define the parameters for the start. Enter clean verify in the Goals: field and press the Run button.


If you are able to see below screen on console, so it means yo have created project sucessfully with maven




This post first appeared on Java Programming Tutorials Online For Java Coder, please read the originial post: here

Share the post

How to Create a java project with Maven in Eclipse IDE

×

Subscribe to Java Programming Tutorials Online For Java Coder

Get updates delivered right to your inbox!

Thank you for your subscription

×