<?xml version="1.0" encoding="UTF-8"?>
<!--
| 官方文档: https://maven.apache.org/settings.html
|
| Maven 提供以下两种 level 的配置:
|
| 1. User Level. 当前用户独享的配置, 通常在 ${user.home}/.m2/settings.xml 目录下。
| 可在 CLI 命令行中通过以下参数设置: -s /path/to/user/settings.xml
|
| 2. Global Level. 同一台计算机上的所有 Maven 用户共享的全局配置。 通常在${maven.home}/conf/settings.xml目录下。
| 可在 CLI 命令行中通过以下参数设置: -gs /path/to/global/settings.xml
|
| 备注: User Level 优先级 > Global Level
|-->
<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">
<!--
| Maven 依赖搜索顺序, 当我们执行 Maven 命令时, Maven 开始按照以下顺序查找依赖的库:
|
| 步骤 1 - 在本地仓库中搜索, 如果找不到, 执行步骤 2, 如果找到了则执行其他操作。
| 步骤 2 - 在中央仓库中搜索, 如果找不到, 并且有一个或多个远程仓库已经设置, 则执行步骤 4, 如果找到了则下载到本地仓库中已被将来引用。
| 步骤 3 - 如果远程仓库没有被设置, Maven 将简单的停滞处理并抛出错误(无法找到依赖的文件)。
| 步骤 4 - 在一个或多个远程仓库中搜索依赖的文件, 如果找到则下载到本地仓库已被将来引用, 否则 Maven 将停止处理并抛出错误(无法找到依赖的文件)。
|-->
<!-- 地仓库路径, 默认值: ${user.home}/.m2/repository -->
<localRepository>${user.home}/workspace/env/maven/repository</localRepository>
<!-- 当 maven 需要输入值的时候, 是否交由用户输入, 默认为true;false 情况下 maven 将根据使用配置信息进行填充 -->
<interactiveMode>true</interactiveMode>
<!-- 是否支持联网进行 artifact 下载、 部署等操作, 默认: false -->
<offline>false</offline>
<!--
| 搜索插件时, 如果 groupId 没有显式提供时, 则以此处配置的 groupId 为默认值, 可以简单理解为默认导入这些 groupId 下的所有 artifact(需要时才下载)
| 默认情况下该列表包含了 org.apache.maven.plugins和org.codehaus.mojo
|
| 查看插件信息:
| mvn help:describe -Dplugin=org.apache.maven.plugins:maven-compiler-plugin:3.5.1 -Ddetail
|-->
<pluginGroups>
<!-- plugin 的 groupId -->
<!--
<pluginGroup>com.your.plugins</pluginGroup>
-->
</pluginGroups>
<!-- 进行远程服务器访问时所需的授权配置信息。通过系统唯一的 server-id 进行唯一关联 -->
<servers>
<server>
<!-- 这是 server 的 id, 该 id 与 distributionManagement 中 repository 元素的id 相匹配 -->
<id>server_id</id>
<!-- 鉴权用户名 -->
<username>auth_username</username>
<!-- 鉴权密码 -->
<password>auth_pwd</password>
<!-- 鉴权时使用的私钥位置。和前两个元素类似, 私钥位置和私钥密码指定了一个私钥的路径(默认是/home/hudson/.ssh/id_dsa)以及如果需要的话, 一个密钥 -->
<privateKey>path/to/private_key</privateKey>
<!-- 鉴权时使用的私钥密码, 非必要, 非必要时留空 -->
<passphrase>some_passphrase</passphrase>
<!--
| 文件被创建时的权限。如果在部署的时候会创建一个仓库文件或者目录, 这时候就可以使用权限(permission
maven setting.xml 中文配置详解(全配置)
最新推荐文章于 2024-01-30 17:33:30 发布