Maven's settings.xml file standard

aims

1. Default jdk using java8

2. Configure Ali cloud images and PW mirror, and start with Ali cloud download, download invisible again PW download

<?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>${user.home}/.m2/repository</localRepository>
  
    <!-- Apache Maven 配置 -->
    <pluginGroups/>
    <proxies/>

    <! - ->PW distribution username and password
    <servers>
        <server>
            <id>releases</id>
            <username>deployment</username>
            <password>He2019</password>
        </server>
        <server>
            <id>snapshots</id>
            <username>deployment</username>
            <password></He2019password>
        </server>
    </servers>
    
    <!-- 阿里云镜像 -->
    <mirrors>
        <mirror>
            <id>alimaven</id>
            <name>aliyun maven</name>
            <!-- https://maven.aliyun.com/repository/public/ -->
            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
            <mirrorOf>central</mirrorOf> 
        </ Mirror > 
    </ Mirrors > 

    <-! Configuration: java8, Ali cloud start the download, did not go Sifu download   -> 
    <-! 20,190,929 hepengju test results: Impact download order is the order of the configuration profiles labels (ali warehouse configured to download later), rather than the order activeProfiles -> 
    < Profiles > 
        <-! global jDK1.8 configuration -> 
        < Profile > 
            < ID > jdk1.8 </ ID > 
            < Activation > 
                < activeByDefault > to true </ activeByDefault > 
                < JDK > . 1.8</jdk>
            </activation>
            <properties>
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
                <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>

        
        <!--Nexus PW configured: to third download jar package, such as driver jdbc oracle like -> 
        < Profile > 
            < ID > dev </ ID > 
            < Repositories > 
                < Repository > 
                    < ID > Nexus </ ID > 
                    < URL > HTTP: / /118.24.46.154:8081/nexus/content/groups/public/ </ URL > 
                    < Releases > 
                        < Enabled > to true </ Enabled > 
                    </ Releases > 
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>public</id>
                    <name>Public Repositories</name>
                    <url>http://118.24.46.154:8081/nexus/content/groups/public/</url>
                </pluginRepository>
            </pluginRepositories > 
        </ Profile > 
        
        <-! Ali cloud configurations: increase domestic jar package download speed -> 
        < Profile > 
            < the above mentioned id > Ali </ the above mentioned id > 
            < Repositories > 
                < Repository > 
                    < the above mentioned id > alimaven </ the above mentioned id > 
                    < name > aliyun Maven </ name > 
                    < URL > http://maven.aliyun.com/nexus/content/groups/public/ </ URL > 
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>alimaven</id>
                    <name>aliyun maven</name>
                    <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
                </pluginRepository>
            </pluginRepositories>
        </profile>

    </profiles>
    
    <!-- 激活配置 --> 
    <activeProfiles>
        <activeProfile>jdk1.8</activeProfile>
        <activeProfile>dev</activeProfile>
        <activeProfile>ali</activeProfile>
    </activeProfiles>
</settings>

 

Guess you like

Origin www.cnblogs.com/hepengju/p/11610451.html