Detailed explanation of Maven Global profile settings.xml
This article introduces the relevant knowledge of "detailed explanation of Maven global configuration file settings.xml". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Reference link 1 Magi Maven Settings Reference
Refer to link 2 for details of the maven global configuration file settings.xml
The main elements of the settings file are as follows:
1. Settings.xml action
Sets the configuration file for the maven parameter. Settings.xml is the global configuration file for maven. The pom.xml file is the local configuration of the project.
Settings.xml contains configurations such as local warehousing location, modification of remote warehousing server, authentication information, etc.
2. Settings.xml location
Global configuration: ${M2_HOME} / conf/settings.xml
User configuration: user.home/.m2/settings.xmlnote: user configuration takes precedence over global configuration
It should be noted that local configuration takes precedence over global configuration.
Configure priority from high to low: pom.xml > user settings > global settings
If there is a duplicate configuration, the higher priority configuration will override the lower priority configuration.
3. Configuration of main elements of settings.xml
3.1 LocalRepository: the path to build the local repository of the system. The default value is ~ / .m2 / repository. To save disk space, the location is generally specified as follows:
E:/m2repository
3.2 Offline: indicates whether maven needs to be run in offline mode. The default is false. Due to network settings or security reasons, the construction server cannot connect to the remote repository. It can be configured as true.
True
3. 3 Mirrors: download image list configured for warehouse list
4. My settings.xml (mainly for backup)
E:/m2repository true true nexus central http://maven.aliyun.com/nexus/content/groups/public/ nexus-public-snapshots public-snapshots http://maven.aliyun.com/nexus/content/repositories/snapshots/ central Maven Repository Switchboard http://repo1.maven.org/maven2/ central repo2 central Human Readable Name for this Mirror. Http://repo2.maven.org/maven2/ ibiblio central Human Readable Name for this Mirror. Http://mirrors.ibiblio.org/pub/mirrors/maven2/ jboss-public-repository-group central JBoss Public Repository Group http://repository.jboss.org/nexus/content/groups/public maven.net.cn oneof the central mirrors in china http:/ / maven.net.cn/content/groups/public/ central "Maven global configuration file settings.xml detailed explanation", so much for introduction. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!