maven的setting配置远程仓库,优先使用公司的maven仓库,如果找不到再去阿里的maven库找。


 

maven的setting,配置远程库。

  <mirrors>
    <mirror>
      <id>mirror-local</id>
      <!-- 优先从这个id的远程仓库取 -->
      <mirrorOf>local-repo</mirrorOf> 
      <url>http://10.1.1.1:8081/nexus/content/groups/public/</url>
    </mirror>
    <mirror>
      <id>mirror-aliyun</id>
      <!-- 不在本地仓库的文件才从该镜像获取 -->
      <mirrorOf>external:*</mirrorOf> 
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
    </mirror>
  </mirrors>

 

 

本地库配置

</profiles>
    <profile>
        <id>profile-local</id>
        <activation>
            <activeByDefault>true</activeByDefault>    
        </activation>
        <repositories>
            <repository>
                <id>local-repo</id>
                <url>http://10.1.1.1:8081/nexus/content/groups/public</url>
                <releases><enabled>true</enabled></releases> 
                <snapshots>
                    <enable>true</enable>
                    <updatePolicy>daily</updatePolicy>    
                </snapshots>
            </repository>
        </repositories>
    </profile>
</profiles>

<activeProfiles> <activeProfile>profile-local</activeProfile> </activeProfiles>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM