Maven配置阿里云镜像

在settings.xml文件中的mirrors下添加mirror标签


    <mirror>
        <id>alimavenid>
        <mirrorOf>centralmirrorOf>
        <name>aliyun mavenname>
        <url>http://maven.aliyun.com/nexus/content/repositories/central/url>
    mirror>
 
 
    
    <mirror>
        <id>repo1id>
        <mirrorOf>centralmirrorOf>
        <name>Human Readable Name for this Mirror.name>
        <url>http://repo1.maven.org/maven2/url>
    mirror>
 
 
    
    <mirror>
        <id>repo2id>
        <mirrorOf>centralmirrorOf>
        <name>Human Readable Name for this Mirror.name>
        <url>http://repo2.maven.org/maven2/url>
    mirror>

pom文件里也可以用下面这种方式

<repositories>
        <repository>
            <id>maven-aliid>
            <url>http://maven.aliyun.com/nexus/content/groups/public//url>
            <releases>
                <enabled>trueenabled>
            releases>
            <snapshots>
                <enabled>trueenabled>
                <updatePolicy>alwaysupdatePolicy>
                <checksumPolicy>failchecksumPolicy>
            snapshots>
        repository>
    repositories>

设置本地仓库路径

 <localRepository>D:\repositorylocalRepository>

你可能感兴趣的:(Maven配置阿里云镜像)