美文网首页
maven使用公司私服作为镜像代理访问外部仓库

maven使用公司私服作为镜像代理访问外部仓库

作者: 码农梦醒 | 来源:发表于2019-12-04 06:17 被阅读0次

    maven的settings.xml配置

    <mirrors>
         <mirror>
            <!--该镜像的唯一标识符。id用来区分不同的mirror元素。 -->
            <id>maven-public</id>
            <!--镜像名称 -->
            <name>maven-public</name>
            <!--*指的是访问任何仓库都使用我们的私服-->
            <mirrorOf>*</mirrorOf>
            <!--该镜像的URL。构建系统会优先考虑使用该URL,而非使用默认的服务器URL。 -->
            <url>http://192.64.23.111:8085/repository/maven-public/</url>       
        </mirror>
    </mirrors> 
    
      <profiles>
        <profile> 
            <id>nexus</id> 
            <repositories>
              <!--- 配置代码仓库 --> 
              <repository> 
                <id>nexus</id> 
                <name>Nexus</name> 
                <url>http://192.64.23.111:8085/nexus/content/groups/public/</url> 
                <releases>
                     <!-- 是否可以下载release的包  true为空,false为不可以,默认为false-->
                    <enabled>true</enabled>
                </releases> 
                <snapshots>
                    <!-- 是否可以下载snapshots的包  true为空,false为不可以,默认为false-->
                    <enabled>true</enabled>
                </snapshots> 
              </repository> 
            </repositories> 
            
            <pluginRepositories> 
              <!-- 配置插件仓库 -->
              <pluginRepository> 
                <id>nexus</id> 
                <name>Nexus</name> 
                <url>http://192.64.23.111:8085/nexus/content/groups/public/</url> 
                <releases><enabled>true</enabled></releases> 
                <snapshots><enabled>true</enabled></snapshots> 
              </pluginRepository> 
            </pluginRepositories> 
            
        </profile> 
      </profiles>
      
      <activeProfiles> 
          <!-- 激活仓库配置(只有激活之后才会生效)  -->
          <activeProfile>nexus</activeProfile> 
      </activeProfiles>
    

    原文地址: https://blog.csdn.net/Fyf_010316/article/details/100931405

    相关文章

      网友评论

          本文标题:maven使用公司私服作为镜像代理访问外部仓库

          本文链接:https://www.haomeiwen.com/subject/sjkkgctx.html