Are Getting issue in config Maven on window:
To download Maven :
1. Go to the maven download:
https://maven.apache.org/download.cgi
Go to dropdown- select mirror
Select the respective file to download wrt your machine like : I am doing from windows:
Once the zip file download extract to the folder:
Go to View Advance system settings -> Environment Variable :
Go to users variable -> New - >
Enter variable name = M2_Home
and variable value = C:\Users\Downloads\apache-maven-3.6.3-bin (1)\apache-maven-3.6.3
Click OK
Again Click New
Enter variable name = M2
and variable value = %M2_Home%\bin
Click OK
Enter variable name = path
and variable value = %M2%
Click OK
Now go command prompt
To Check maven version :
C:\User\Desktop> mvn --version or mvn -v
-------------------------------------------------------------------------------------------------------
Here I am showing you how to creat your own MAVEN Tree/project:
In this, the files/maven folder structure will be downloaded from maven central to your local machine, so internet is required.
The content is given on the Maven website :
https://maven.apache.org/guides/introduction/introduction-to-archetypes.html
There are various Archetypes are given:
Let me show you on my local machine how do I install and created my folder:
First, navigate to cmd to your specified folder where you want those three to be developed:
and provide command:
C:\Users\Desktop\ankMavenPrac>mvn archetype:generate
where : " mvn " is batchfile , "archetype" is plugin & "generate" is goal
Maven Coordinates = groupId + artifactId + versionOnce all files downloaded from Central to local, the system will ask you for Maven Coordinates :
To check the maven project tree:
go to -> cd sample1
C:\Users\Desktop\ankMavenPrac\sample1>tree
-------------------------------------------------------------------------------------------------
Maven Goals:
There are basically three stages in the lifecycle in Maven that is :
- Clean ,
- Default and
- Site
1. Clean: The clean phase in the maven lifecycle has three phases pre-clean, clean & post-clean.
2. Default: This phase comprises 23 phases which are validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, pots-integration-test, verify, install, and deploy.
3. Site: Ths is is the final stage in the maven lifecycle having 4 phases: pre-site, site, post-site & site-deploy.
So if the user provides, any phase like from down in the flowchart: COMPILE so that all phases would flow since from pre-clean to compile.
Similarly, if we provide site, so it would flow all phases since from pre-clean to site.
No need to provide each and every phase during run.
Comments
Post a Comment