I want to talk about Maven. It’s very powerful instrument and if you know how to use it you will make minimum effort to achieve maximum result. In general Apache Maven helps you to manage a project including library dependencies, building process and etc…
Here is a simple tutorial which you can go through to create Eclipse Project using maven. This project can be used as base project and can be easily converted to most kind of advanced Java Project like Spring MVC based etc.
Tools I’m using:
· Eclipse EE Download, latset Eclipse
· Maven Download, Maven Setup
· JDK 8 Download, latest Java
· M2Eclipse Plugin
You have setup Maven Server successfully in your Eclipse Environment.
There are few steps as follows.
Create simple maven project in eclipse, go to Eclipse menu bar.
Open new window. Select maven project, as mention below.
Select default work space location otherwise press browse button and set new work space.
After pressing Next button new window open in that window you have to configure your project details of maven like as group id, artifact id and version etc.
Press Finish button. You have successfully create maven sample project in eclipse. In that screen after create project maven build automatically. Supposed you need to added some jar file, then just write jar dependency in pom.xml file and this file is build maven project.
You have successfully created maven project in eclipse and maven also build. You can also build and test maven project..Click on existing project.
After maven test you get success or fail message on your eclipse console window, see the sample screen shot in below mention screen. In that screen shot you can see the maven project structure, pom.xml file and console window. This was highlighted using square, arrows and oval.
After building maven successfully, you can run sample maven project.
Click on existing project, then
See the console window on eclipse tool; you can see the output of maven project.
Using above steps you can easily create maven project in eclipse tool.
Sample Apache Maven example also provided. Just Click on below link…
If you like this blog then please subscribe and suppose you have any queries or suggestions then comment below.