All build systems are essentially the same. All they have done is same tasks again and again.
- compile source code
- copy recourses
- compile and run tests
- package project
- deploy project
- cleanup
Project Object Model (POM)
POM is a XML file that contains information about project and configuration details used by maven to build the project. It describe the project name, version, Artifact type, source code locations, dependencies, plugins etc.
Install and setup Maven
Make sure that JDK is installed and JAVA_HOME variable is added as windows system variables.
- Download maven
- Set environment variables for maven
- go to system properties -> Environment variables
3. Append to System path variable
- Check whether maven install correctly
Create First Maven Project
For this tutorial I have created folder called "maven-test-project". Go to that folder and open command prompt inside it.( press shift and right click inside folder >> inside menu you will see "open command window here" click that ).
now type mvn archetype:generate
P.S. :make sure that you are connected to internet
Then it will be automatically download maven archetype plugin when you are required in your first maven project. This is happen only for first time.
After some time you will see a window like above. Those numbers indicate various archetypes which you are choose from. In default it gives archetype of maven hello world program.This number can be different in your case. Now I pressed enter to make default maven hello world program.
now it will give you options like below.
since archetypes are the templates, they are evolve in time. Thus They have their own versions. For this tutorial I am going to choose option 6 ( latest version ). press enter for option 6.
In next step it will be ask to provide group id
Group id is unique among organization or project. In this case I use " com.logicx ".
Next it will ask artifactId
ArtifactId is the project name In this case I use "maven-test-project"
Next it will ask version
SNAPSHOT means this is development version not a release version. In this case I give "1.0-SNAPSHOT" as version
Next it will ask package
It gives package hint as com.logicx (In my case) I accept it.
Next it will ask confirmations for your choices press "y" and enter
see you soon with next tutorial.
next : Create maven project using intellij, dependency management, Build lifecycle etc.
what is the differnce between the Intellij vs marven?Is it same?. thakz for the lesson
ReplyDeleteIntellij is a IDE (Integrated Development Environment) but marven is a build tool. It can build your project dependencies. marven can be use with other IDE's as well.
ReplyDeleteWow nice work buddy.
ReplyDeleteWow nice work buddy.
ReplyDelete