Maven:settings.xml示例

来自Wikioe
Eijux讨论 | 贡献2022年5月7日 (六) 18:11的版本 (创建页面,内容为“category:Maven == 示例一:central、central == 阿里云Maven仓库地址:[https://developer.aliyun.com/mvn/guide https://developer.aliyun.com/mvn/guide] '''settings.xml'''<span class="darken mw-customtoggle-settings.xml.example1"><font color="blue">'''(展开/隐藏)'''</font></span> : <syntaxhighlight lang="xml" highlight="" class="darken mw-collapsible mw-collapsed" id="mw-customcollapsible-settings.xml.example1"> <?xml version="1.0" encodin…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳到导航 跳到搜索


示例一:central、central

阿里云Maven仓库地址:https://developer.aliyun.com/mvn/guide

settings.xml(展开/隐藏)

如上,配置了:

  1. 本地仓库路径为:“D:\Repository”;
  2. 一个 profile(dev),包含两个 repository(aliyun、central)、两个 pluginRepository(aliyun、central);
  3. 两个 mirror:(repo1、repo2),用作 repository(central)的镜像;
    • repo1、repo2 镜像可以更新索引,但不稳定且速度慢;
  4. 在 activeProfiles 中启用了 profile(dev);

效果

在 Eclipse 中:

Eclipse中的Maven仓库

在 IDEA 中:

Idea中的Maven仓库

示例二:nexus2/3

settings.xml(展开/隐藏)

如上,配置了:

  1. 本地仓库路径为:“D:\Repository”;
  2. 一个 profile(dev),包含两个 repository(aliyun、central)、两个 pluginRepository(aliyun、central);
  3. 两个 mirror:(repo1、repo2),用作 repository(central)的镜像;
    • repo1、repo2 镜像可以更新索引,但不稳定且速度慢;
  4. 在 activeProfiles 中启用了 profile(dev);

效果

在 Eclipse 中:

Eclipse中的Maven仓库

在 IDEA 中:

Idea中的Maven仓库

附:“${user.home}/.m2/settings.xml”备份

settings.xml(展开/隐藏)