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
Let's take an example: The code is very simple...
Let me share with you a creative opening realized...
1. Use the mysql/mysql-server:latest image to qui...
Table of contents 1. Plugins 2. Interlude 3. Impl...
There is a simple CSS method to realize the pop-u...
Experimental environment • A minimally installed ...
Sprite Cow download CSS Lint download Prefixr dow...
When it comes to pictures, the first thing we thi...
Using cutecom for serial communication in Ubuntu ...
Time flies, and in just six days, 2013 will becom...
Download and installConfigure environment variabl...
1. Why create an index? (Advantages) This is beca...
Deployment environment: Installation version red ...
This article shares the specific code of Vue+Webs...
describe This article introduces a method to impl...