Maven core program installation and necessary settings for local warehouse

Installation of Maven core program and necessary settings for local warehouse

  1. Check the JAVA_HOME environment variable.
    Maven is developed using Java, so you must know the installation directory of the JDK in the current system environment.
C:\Windows\System32>echo %JAVA_HOME%
C:\Java\jdk1.8.0_45
  1. Unzip the core program of Maven Unzip
    apache-maven-3.5.0-bin.zip to a non-Chinese directory with no spaces
  2. Configure environment variables
M2_HOME    
D:\Server\ apache-maven-3.5.0
path
%M2_HOME%\bin或D:\Server\ apache-maven-3.5.0\bin
  1. View Maven version information to verify the installation is correct
    cmd mvn -v
  2. Configure the local warehouse
    [1] Maven default local warehouse: ~.m2\repository directory.
    Tips: ~ represents the root directory of the current user.
    [2] Maven's core program does not contain specific functions, only responsible for macro scheduling. The specific function is completed by the plug-in. The Maven core program will look for plugins in the local repository. If not in the local warehouse, it will be downloaded from the remote central warehouse. At this time, if you cannot access the Internet, you cannot perform the specific functions of Maven. To solve this problem, we can point Maven's local warehouse to a directory that has been downloaded on the Internet.
    [3] Location of Maven's core configuration file:
    unzip directory \ D:\Server\ apache-maven-3.5.0\conf\settings.xml
    [4] Setting method
<localRepository>以及准备好的仓库位置</localRepository>
列<localRepository>D:/RepMaven</localRepository>

Guess you like

Origin blog.csdn.net/weixin_44051191/article/details/109238289