Downloading from maven-default-http-blocker的解决办法

前言

配置了一个私有仓库地址,下载依赖的时候有警告,依赖下载不下来,仔细看地址有问题,编程0.0.0.0了:

Downloading from maven-default-http-blocker: http://0.0.0.0/com/jeremytsai/jeremy-basic-common/1.0.0/maven-metadata.xml
[WARNING] Could not transfer metadata com.jeremytsai:jeremy-basic-common:1.0.0/maven-metadata.xml from/to maven-default-http-blocker (http://0.0.0.0/): transfer failed for http://0.0.0.0/com/jeremytsai/jeremy-basic-common/1.0.0/maven-metadata.xml

搜索了一下,发现从3.8.1版本开始,maven禁止了从http协议的仓库地址下载依赖。

解决办法

通过配置mirror来突破限制。

<mirror>
	<id>maven-default-http-blocker</id>
	<mirrorOf>blocker</mirrorOf>
	<name>用于突破maven-3.8.1版本以后默认禁用http仓库的限制</name>
	<url>http://0.0.0.0/</url>
</mirror>

以可以切换为旧版本的maven,就没有该限制。

其他解决办法

  1. 降低Maven版本
  2. 将私有仓库升级为https
  3. 通过配置mirror解决
    不同于上文,maven限制的是repository不能使用http,没有限制mirror不能使用,可以将自己的私有仓库写在mirror中而不是repository。该方法同样简单。
    <mirror>
    	<id>jeremy-maven</id>
    	<mirrorOf>*</mirrorOf>
    	<name>Jeremy的公共仓库</name>
    	<url>http://1.2.3.4/repository/public</url>
    </mirror>
    

引用


若文章有误,或你有什么见解,欢迎留言指正和交流。
原创不易,若有所帮助,欢迎点赞、收藏。

  • 3
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
D:\springboot\hspedu_springboot_vue>mvn org.springframework.boot:spring-boot-maven-plugin:run [INFO] Scanning for projects... Downloading from central: https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-maven-plugin/maven-metadata.xml Downloaded from central: https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-maven-plugin/maven-metadata.xml (7.2 kB at 2.6 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-maven-plugin/3.1.0/spring-boot-maven-plugin-3.1.0.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-maven-plugin/3.1.0/spring-boot-maven-plugin-3.1.0.pom (3.2 kB at 4.1 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-maven-plugin/3.1.0/spring-boot-maven-plugin-3.1.0.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-maven-plugin/3.1.0/spring-boot-maven-plugin-3.1.0.jar (130 kB at 108 kB/s) [INFO] [INFO] ------------------< org.apache.maven:standalone-pom >------------------- [INFO] Building Maven Stub Project (No POM) 1 [INFO] --------------------------------[ pom ]--------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 6.851 s [INFO] Finished at: 2023-05-31T00:33:26+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.1.0:run (default-cli): Goal requires a project to execute but there is no POM in this directory (D:\springboot\hspedu_springboot_vue). Please verify you invoked Maven from the correct directory. -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException怎么解决
05-31

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值