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
Table of contents 1. Structure string 2. Return t...
PCIE has four different specifications. Let’s tak...
In MySQL, most indexes (such as PRIMARY KEY, UNIQ...
1. CSS Miscellaneous Icons There are three ways t...
Table of contents 1. Introduction 2. Deployment E...
In Nginx, there are some advanced scenarios where...
On some websites, you can often see some pictures...
Table of contents Problems with resource manageme...
What is DOM? With JavaScript, you can reconstruct...
ask: I have styled the hyperlink using CSS, but i...
How to view version information under Linux, incl...
Preface The previous article introduced the insta...
Table of contents 1 System Introduction 2 System ...
1.17.9 More delicious, really Nginx download addr...
Use the following terminal command to install the...