M2 folder.
Source of the.m2 folder
Once you run the maven command in the unit, you will be in the local ${user. The name} / m2 path to create a folder, such as my MAC path is/Users/apple/m2 (apple is my computer user name), this means that the folder is in view of the logged in user’s computer, Different users will have different.m2 folders
M2 Folder contents
There are two possible files: 1.settings. XML (default does not exist, belongs to user level Maven configuration) 2. Repository folder (Maven pulls dependencies locally in this directory by default, if localRepository is configured, in the configured file directory)
Settings. The XML file
If you create a settingx. XML file in the.m2 folder, it will have a higher priority than Maven The two settingx. XML files in the conf configuration are merged by default
local repository
If you set up maven local repository
If you need to specify the location of your local Maven repository, add D: Eclipse\jars\maven to settings. XML
The consequence of setting up the local warehouse incorrectly
In Windows, you can change the location so that disk C does not exist, but in MAC, there is no need to change the configuration, especially if the MAC configuration is written to a relative path, then the idea application will be created, which cannot be used by path at all. ClassNotFoundeException will appear when you start your Maven project because the associated Maven dependencies cannot be accessed. View the location where maven management dependencies exist in idea Fiel -> Project Structure
How to specify settings. XML and local repository for maven