Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

What is the maven _ home variable in maven?


Asked by Phillip Acosta on Dec 07, 2021 Maven



MAVEN_HOME is an environment variable that should point to the install directory of the Maven tool setup. Some inbuilt scripts use this variable. It’s important to set up this variable for the smooth running of the Maven tool.
Next,
Ask Cortana or key in “ Edit the system environment variables ” in the search bar. In the Advanced Tab >> Click on the Environment Variables… button. Click on the New… button to create a new environment variable. Add a MAVEN_HOME variable and point it to c:maven directory. Click on the OK button.
In addition, Open command terminal and set environment variables. Now append M2 variable to System Path. Append the string ;%M2% to the end of the system variable, Path. Now open console and execute the following mvn command. Finally, verify the output of the above commands, which should be as follows −
Thereof,
In the Advanced Tab >> Click on the Environment Variables… button. Click on the New… button to create a new environment variable. Add a MAVEN_HOME variable and point it to c:maven directory. Click on the OK button. Now add the Maven bin folder to the PATH variable. Select the Path variable in the user variables.
And,
MAVEN_HOME is used for maven 1 and M2_HOME is used to locate maven 2. Having the two different _HOME variables means it is possible to run both on the same machine. Anyway usage of this pattern is now deprecated with maven 3.5 as per the documentation.