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:
2. Select location -> check box Use default work location then click 'next'
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.
Prerequisits:
- Eclipse should be installed.
- jdk should be installed atleast jdk 1.6 or jdk 1.6+.
- Install Maven plugin if not integrated with eclipse.
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