maven的配置文件settings在两个地方:
1.安装的地方。
2.用户的目录。
安装的地方的配置被叫做全局配置。
后者被称为用户配置。
如果两者都存在,它们的内容将被合并,并且用户范围的settings.xml会覆盖全局的settings.xml。
在maven的配置文件中,主要通过各种节点来完成配置:
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<!--完成maven配置的各种节点-->
<!--localRepository节点:用于设置本地库-->
<localRepository>D:\jar_reportery</localRepository>
<!--interactiveMode节点:确当maven是否需要和用户交互以获得输入,true为确定(默认值亦为true)-->
<interactiveMode>true</interactiveMode>
<!--usePluginRegistry节点:是否需要plugin-registry文件来管理插件,默认为false-->
<usePluginRegistry>false</usePluginRegistry>
<!--offline:是否需要在离线模式下运行,默认为false,但当网络环境差时,设置为true是很有用的-->
<offline>false</offline>
<!--pluginGroups:当未能提供组织id时,则通过此节点来-->
<pluginGroups>
<pluginGroup>组织ID</pluginGroup>
</pluginGroups>
<!--proxies:用于配置代理设置-->
<!--servers:配置服务端的配置-->
<!--mirrors:配置镜像-->
<mirrors>
<mirror>
<id>镜像唯一标识符</id>
<name>镜像名称</name>
<url>镜像地址</url>
<mirrorOf>central</mirrorOf><!--
-->被镜像的服务器的id。例如,如果我们要设置了一个Maven中央仓库(http://repo.maven.apache.org/maven2/)的镜像,就需要将该元素设置成central。这必须和中央仓库的id central完全一致。
</mirrors>
</settings>