首页 > 网页开发手记 > Maven Config

Maven Config

Maven在国内,网络原因导致下载速度很慢,可以采用使用国内镜像站来加速。

配置参考如下,注意,这里的源站采集很麻烦,故直接引用了镜像站地址,理论上应该采用原地址,然后在mirror中配置镜像站地址。

<?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">


  <mirrors>
    <mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
      <mirrorOf>central</mirrorOf>
    </mirror>
  </mirrors>

  <profiles>
    <profile>
        <id>nexus</id>
        <repositories>
             <repository>
               <id>central</id>
               <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
               <releases><enabled>true</enabled></releases>
             </repository>
            <repository>
                <id>3 party</id>
                <url>http://maven.aliyun.com/nexus/content/repositories/thirdparty</url>
                <releases><enabled>true</enabled></releases>
            </repository>
            <repository>
                <id>apache-snapshots</id>
                <url>http://maven.aliyun.com/nexus/content/repositories/apache-snapshots</url>
                <snapshots><enabled>true</enabled></snapshots>
            </repository>
            <repository>
                <id>jcenter</id>
                <url>http://maven.aliyun.com/nexus/content/repositories/jcenter</url>
                <releases><enabled>true</enabled></releases>
            </repository>
            <repository>
                <id>snapshots</id>
                <url>http://maven.aliyun.com/nexus/content/repositories/snapshots</url>
                <snapshots><enabled>true</enabled></snapshots>
            </repository>
        </repositories>
        <pluginRepositories>
             <pluginRepository>
               <id>ali-central</id>
               <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
               <releases>
                 <enabled>true</enabled>
               </releases>
               <snapshots>
                <enabled>false</enabled>
               </snapshots>
             </pluginRepository>
        </pluginRepositories>
    </profile>
    
  </profiles>
    <activeProfiles>
        <activeProfile>nexus</activeProfile>
    </activeProfiles>
</settings>

具体参考:
1, [Maven官方网站]1
2, [AliMaven镜像站点]2

附,采用淘宝镜像站的配置文件


知识共享许可协议
本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可。

上一篇: 浅谈Win系统优化-上篇

下一篇: 已是最新的文章

评论已关闭