首页 > Web开发 > 详细

maven仓库提示“Downloading: http://repo.maven.apache.org/maven2/”

时间:2020-02-07 23:45:20      阅读:1169      评论:0      收藏:0      [点我收藏+]

问题描述

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>

 

maven仓库提示“Downloading: http://repo.maven.apache.org/maven2/”

原文:https://www.cnblogs.com/handongxue/p/12274903.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!