1. Download Maven Maven official website: http://maven.apache.org/ Download it as a compressed file, unzip it. I downloaded version 3.5.2, and after decompression, it is as follows: The path is: 2. Configure environment variables Add custom variable: MAVEN_HOME The value is the decompression path just now: D:\Program Files\apache-maven-3.5.2. Add 3. Verify whether the installation is successful Open a command line and enter: 4. Configure local warehouse The most direct benefit of using Maven is the unified management of jar packages. So where are these jar packages stored? They are in your local repository, and the default address is in the C:\Users\username.m2 directory (of course, you can also modify this default address). Let's modify this default address. In fact, we can understand the local warehouse as a "cache" to store jar packages. When developing a project, the project will first obtain the jar package from the local warehouse. When the specified jar package cannot be obtained, the local warehouse will download the jar package from the remote warehouse (or central warehouse) and "cache" it in the local warehouse for future use. The remote repository (central repository) is officially provided by Maven and can be accessed through http://search.maven.org/. In this way, the local warehouse will grow larger as the projects accumulate. The following picture can clearly express the relationship between projects, local repositories, and remote repositories. Now that Maven is installed, the local repository is also available, and the default path is in our C drive directory. But the C drive is always dangerous, so how to modify this default configuration. Open the Maven installation directory\conf\setting.xml file. <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <!-- localRepository | The path to the local repository maven will use to store artifacts. | | Default: ${user.home}/.m2/repository <localRepository>/path/to/local/repo</localRepository> --> <localRepository>E:\Maven_Repo</localRepository> ... </settings> Then the default local warehouse location has been changed to the E:\Maven_Repo directory. It is best to create this directory manually first. 5. Check whether the settings just now are effective Command line input: If there are no problems, the configuration is successful. Now let's go to the E:\Maven_Repo directory and find that there are many more files in this directory. These are the files that Maven downloaded from the central repository. Summarize The above is the graphic tutorial of Maven installation and configuration under Windows (including localized warehouse configuration) introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time! You may also be interested in:
|
<<: Detailed explanation of the working principle and solution of Js modularization
>>: mysql5.7.21.zip installation tutorial
Preface Sometimes you need to keep the height of ...
GitHub address: https://github.com/dmhsq/dmhsq-my...
1. Download docker online yum install -y epel-rel...
Configure the accelerator for the Docker daemon S...
Select the category selection. After testing, IE ...
The default port number of the Windows server rem...
Attribute check-strictly The official document pr...
It took me more than an hour to open ssh in Ubunt...
Table of contents How to set cookies Disadvantage...
1. The difference between Http and Https HTTP: It...
CSS issues about background gradient and automati...
When I was writing a program a few days ago, I wan...
This article uses an example to describe how to q...
1. Download MySQL Official website download addre...
This article shares with you a detailed tutorial ...