zoukankan      html  css  js  c++  java
  • maven仓库提示“Downloading: http://repo.maven.apache.org/maven2/”

    问题描述

    maven setting.xml中配置私有库,但是在mvn install时仍然提示Downloading: http://repo.maven.apache.org/maven2/

    原因

    网上查了很多资料发现了解到所有自定义pom.xml都是继承自super pom,所以maven项目下载一些jar包时,默认会从中央仓库下载

    <repositories>
        <repository>
          <id>central</id>
          <name>Central Repository</name>
          <url>http://repo.maven.apache.org/maven2</url>
          <layout>default</layout>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </repository>
      </repositories>
    
      <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <name>Central Repository</name>
          <url>http://repo.maven.apache.org/maven2</url>
          <layout>default</layout>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <releases>
            <updatePolicy>never</updatePolicy>
          </releases>
        </pluginRepository>
      </pluginRepositories>

    解决办法

    在项目的pom文件中手动指定下私有仓库

    <repositories>
        <repository>
            <id>hanxiaohan</id>
            <url>http://host:port/content/groups/public</url>
        </repository>
    </repositories>
    
    <pluginRepositories>
        <pluginRepository>
            <id>hanxiaohan</id>
            <url>http://host:port/content/groups/public</url>
        </pluginRepository>
    </pluginRepositories>
  • 相关阅读:
    pwnable
    pwnable
    pwnable
    uva 11971
    uva 11582
    【数据结构】关于递归的几个例子
    【数据结构】快速排序
    【Python】range 倒序
    【数据结构】静态链表的实现(C语言描述)
    【数据结构】KMP 算法
  • 原文地址:https://www.cnblogs.com/handongxue/p/12274903.html
Copyright © 2011-2022 走看看