Maven and Java is a best combination you could get for your production project in present time. I don’t see any other combination which best works.
Why Maven? What are the advantages using Maven with Java / Dynamic Web Project?
- Maven project
contains only one pom.xml
file. All the members in team uses the same and only one pom.xml version. This will solve an issue with dependencies. Everybody gets the same dependencies, hence –no more compilation
or other error. - No
more complicated build.xml
file for your Java Production Project. No need to ship
all dependent .jar files with your project. Required .jar files will be downloaded at user side from central location.- Lots of available and
widely used Maven Plugins
for number of different usecases. We already shared on Crunchify some time back. Take a look:- maven-assembly-plugin
- maven-war-plugin
- maven-resources-plugin, maven-dependency-plugin & maven-jar-plugin
- maven-shade-plugin
- Easily specify environment specific profiles with different property values, i.e. Dev, Prod, QA, etc.
Sometime back I’ve created a tutorial to Convert Dynamic Web project to Maven project in Eclipse but in this tutorial we will go over How to create simple Maven project in Eclipse from scratch
.
Let’s get started:
Step-1
- Open Eclipse
- Click on
File
->New
->Maven Project
Step-2
Click on Checkbox for both
- Create a simple project
- Use default Workspace loacation
Step-3
Provide GroupId and ArtifactId in next screen.
- GroupId:
com.crunchify.tutorials
- Artifact Id:
CrunchifySpringMVCFramework
- Name:
CrunchifySpringMVC
- Description: As per your need
Step-4
And you are all set. You should see new Project in Eclipse with below structure.
Step-5
Open pom.xml file. Checkout all properties and get familiar with those. It’s good practice to understand if you want to become pro in Maven technology.
What next?
Try building few Spring MVC tutorials by yourself and let me know if you see any issue.
Want to create Dynamic Web Project instead of simple project?
Instead of Simple Maven project – try following tutorial to create Dynamic Web Project in Eclipse using Maven with maven-archtype-webapp
.