You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
2.8 KiB
54 lines
2.8 KiB
<?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>
|
|
-->
|
|
<pluginGroup>com.spotify</pluginGroup>
|
|
</pluginGroups>
|
|
|
|
|
|
</settings>
|
|
|