There are two way to get started with java project in Maven
1. Use command line tool
2. Use Eclipse or STS.
In this port we will demonstrate how to create a maven project in Eclipse or STS (Spring source tool Suite)
Using Eclipse/ STS to create Java Maven Project
- Click on File –>New Project .
- Select the Maven project.
- In next step, give the name and then go to next step of selecting the archetype. This is important. If you skip the archetype selection, you will no longer be able to run java code.
Arhchetype are maven project templating toolkit. Fastest and easiest way to get started. For more on Archetype refer to maven Arhchetype
Image may be NSFW.
Clik here to view.
- Select maven-archetype-quickstart. Eclipse will try to download if not already present.
- Fill in the details and click finish
- You would be able to see the project in your Eclipse.
- To verify , this is how the Java Build path should look like in Eclipse
- Image may be NSFW.
Clik here to view.