maven environment variable configuration under Windows, maven configuration of the eclipse

first step

To configure maven environment variables, you need to configure the java environment variable
java environment variable configuration URL: https://blog.csdn.net/qq_43642864/article/details/103340857

1.1 Right stand-alone "this computer";
1.2 and select "Properties";
1.3 at this time to enter the "Properties" screen, find the left side of the "Advanced System Settings" and click to enter;
1.4 at this time will directly see the "System Properties" interface " advanced "tab;
1.5 find the following" environment variables ", click to enter;
Here Insert Picture Description

Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description

Step Configuration Variables

2.1 Select system variables "New" and click
successively fill in the variable name: "MAVEN_HOME"
variable value: "C: \ Program Files \ Java \ jdk1.8.0_131" (maven decompression path)
Here Insert Picture Description
When finished, click "OK";
2.2 with other versions of Windows the main difference is the place
to find the system variable "Path" → "edit" (the "edit" instead of "New"!)
to find the "Path" in the "New" → enter: "% MAVEN_HOME% \ bin"
Note: do not add the end ";" semicolon!
When finished, click "OK";
Here Insert Picture Description

The third step, maven verification environment

In cmd, enter: mvn -v, appear as is the case already configured, if not check the first two steps.
Here Insert Picture Description

The fourth step is to configure the local repository

4.1 Configuring local repository

Open the conf file in the root directory of the Maven folder, locate and open the file settings.xml
found in the following code settings.xml
Here Insert Picture Description
and add the following code at the bottom of its content, the role of the configuration is F: / school project / mavenStone folder as your local warehouse. (Note the file path here can configure itself according to the actual situation, not necessarily the "F: / school project / mavenStone")

F: / school project / mavenStone
Here Insert Picture Description

4.2 Configuring remote mirror repository

Settings.xml file found in the nodes, and add the following to this node, the role is Ali cloud repository as remote mirror repository.Note: Mirror warehouse according to actual needs can configure


 <!-- 阿里云仓库 -->
        <mirror>
            <id>alimaven</id>
            <mirrorOf>central</mirrorOf>
            <name>aliyun maven</name>
            <url>https://maven.aliyun.com/repository/central/</url>
        </mirror>

Save the file settings.xml

4.3 configuration information repository in eclipse

Window-> Preferences-Maven-User Settings, click the Browse button and select Back in the edited file setting.xml, as two Browse operation here, are setting.xml select the corresponding file.
Here Insert Picture Description

At last

This, maven and eclipse environment variables have been completed, I wish you all a happy use maven

Released eight original articles · won praise 1 · views 333

Guess you like

Origin blog.csdn.net/qq_43642864/article/details/103559087