一洼绿地

maven settings.xml

·1 min read

Maven 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>/Users/henry/.m2/repository</localRepository>
    <interactiveMode>false</interactiveMode>

    <server>
      <id>sonatype-snapshots</id>
      <username>xxx</username>
      <password>xxxxxxxxx</password>
    </server>

    <server>
      <id>sonatype-release</id>
      <username>xxx</username>
      <password>xxxxxxx</password>
    </server>

    <mirrors>
        <mirror>
            <id>central</id>
            <url>https://repo.maven.apache.org/maven2</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
 
        <!-- 阿里云镜像仓库 -->
        <mirror>
            <id>aliyun</id>
            <url>https://maven.aliyun.com/repository/public</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
 
        <!-- 华为云镜像仓库 -->
        <mirror>
            <id>huaweicloud</id>
            <url>https://mirrors.huaweicloud.com/repository/maven/</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
 
        <!-- 网易云镜像仓库 -->
        <mirror>
            <id>netease</id>
            <url>https://maven.163.com/repository/maven-public/</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
 
        <!-- 清华大学镜像仓库 -->
        <mirror>
            <id>tsinghua</id>
            <url>https://mirrors.tuna.tsinghua.edu.cn/maven/</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
 
        <!-- 华中科技大学镜像仓库 -->
        <mirror>
            <id>huazhi</id>
            <url>https://mirrors.huaweicloud.com/repository/maven-public/</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
 
        <!-- 中国科学技术大学镜像仓库 -->
        <mirror>
            <id>ustc</id>
            <url>http://mirrors.ustc.edu.cn/maven/maven2/</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
 
        <!-- 百度镜像仓库 -->
        <mirror>
            <id>baidu</id>
            <url>https://maven-bd-local-1.services.baidu.com/repository/maven-public/</url>
            <mirrorOf>central</mirrorOf>
        </mirror>

    </mirrors>

    <pluginRepositories>
        <pluginRepository>
            <id>aliyun</id>
            <name>Plugin Repositories</name>
            <url>https://maven.aliyun.com/repository/public</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
 
    <profiles>
 
        <profile>
            <id>default-jdk</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <maven.compiler.source>1.8</maven.compiler.source>
                <maven.compiler.target>1.8</maven.compiler.target>
                <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
            </properties>
        </profile>

        <profile>
            <id>gpg</id>
            <properties>
                <gpg.executable>gpg2</gpg.executable>
                <gpg.passphrase>xxxxxxxx</gpg.passphrase>
            </properties>
        </profile>
        
    </profiles>
</settings>