maven settings.xml

Posted bill-robot

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了maven settings.xml相关的知识,希望对你有一定的参考价值。

maven settings.xml
每次重装maven都需要配置settings.xml所以在这里记录一下
win

C:UsersAdministrator.m2settings.xml
<?xml version="1.0" encoding="UTF-8"?>
<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">
  <localRepository>D:dev_mavenRepository</localRepository>
  <pluginGroups>    
  </pluginGroups>
  <proxies>
  </proxies>
  <servers>
  </servers>
  <mirrors>
    <mirror>
      <id>aliyun</id>
      <name>aliyun</name>
      <mirrorOf>*</mirrorOf>
      <url>https://maven.aliyun.com/repository/public</url>
    </mirror>
  </mirrors>
  <profiles>
  </profiles>
</settings>

linux

/etc/maven/settings.xml或者/opt/apache-maven-3.3.9/conf/settings.xml
<?xml version="1.0" encoding="UTF-8"?>
<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">
  <localRepository>/home/dev_mavenRepository</localRepository>
  <pluginGroups>
  </pluginGroups>
  <proxies>
  </proxies>
  <servers>
  </servers>
  <mirrors>
  <!--设置远程库地址-->
    <mirror>
    <id>aliyun</id>
    <name>aliyun</name>
    <url>https://maven.aliyun.com/repository/public</url>
    <mirrorOf>*</mirrorOf>
    </mirror>
  </mirrors>
  <profiles>
  </profiles>
</settings>

    【微信】打赏二维码:

    技术图片

    【支付宝】打赏二维码:

    技术图片

以上是关于maven settings.xml的主要内容,如果未能解决你的问题,请参考以下文章

Maven命令行窗口指定settings.xml

[转]maven全局配置文件settings.xml详解

maven入门settings.xml

maven settings.xml

Maven入门2-pom.xml文件与settings.xml文件

maven 配置文件 settings.xml pom.xml