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>
  • 相关阅读:
    git 命令
    Spring Boot Web应用开发 CORS 跨域请求支持
    layui demo
    jQuery jqGrid 4.7
    jQurey zTree Demo 3.5
    jQurey zTree API 3.5
    jQurey Select2 4.0
    jQurey Validation 1.16
    Laytpl 1.2
    My97DatePicker 4.8
  • 原文地址:https://www.cnblogs.com/handongxue/p/12274903.html
Copyright © 2011-2022 走看看