[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins....

本文解决了一个因未正确配置代理导致Maven无法下载依赖的问题。作者所在公司的网络需要通过代理服务器访问外网,但在Maven中未配置代理信息,导致Maven无法从中央仓库下载依赖。文章详细介绍了如何在IE浏览器中查找代理服务器设置,并将这些信息应用到Maven的setting.xml文件中。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

这里先说明下我这次解决的maven不能下载插件的前置条件:自己的网络使用了代理,但maven里面没有配置代理。比如我所在的公司访问外网是要通过公司的代理服务器,但我没有在maven里面配置代理服务器。


出现这个 failed to retrieve的情况有几种,优快云上的出现的情况都试过,还是不能解决。stackover也看过,看得半懂不懂,也没解决。


下面看我出现问题:

org.apache.ant:ant:jar:1.8.1: Could not transfer artifact org.apache.maven.archetype:archetype-registry:jar:2.4 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.40.215] failed: Connection refused: connect -> [


这里有个连接被拒绝,经过一个上午加下3小时,才想起我所在的公司是代理访问外网。

解决:1.然后先在IE里面找到代理地址(工具_>选项_>连接);

2.配置 maven/conf/setting.xml;

<proxy>     
<active>true</active> 
<protocol>http</protocol> 

<username>(个人电脑帐号)</username>
<password>(个人电脑帐号密码)</password>

<host>(公司的代理服务器)</host> 
<port>(代理服务器的端口)</port> 

<nonProxyHosts>www.google.com|*.somewhere.com</nonProxyHosts> 
</proxy> 


红色标记需要根据自己情况修改,然后解决了。


第一次发文,可能说的有点乱,望理解。估计也只有我才会遇到这个低级的问题...

这里链接给我解决灵感的博文:http://blog.youkuaiyun.com/nphyez/article/details/34438927

S D:\project_vscode\demo> ./mvnw spring-boot:run [INFO] Scanning for projects... Downloading from central: https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-maven-plugin/与%20Spring%20Boot%20版本一致/spring-boot-maven-plugin-与%20Spring%20Boot%20版本一致.pom [WARNING] Failed to retrieve plugin descriptor for org.springframework.boot:spring-boot-maven-plugin:与 Spring Boot 版本一致: Plugin org.springframework.boot:spring-boot-maven-plugin:与 Spring Boot 版本一致 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.springframework.boot:spring-boot-maven-plugin:pom:与 Spring Boot 版本一致 (absent): Could not transfer artifact org.springframework.boot:spring-boot-maven-plugin:pom:与 Spring Boot 版本一致 from/to central (https://repo.maven.apache.org/maven2): status code: 400, reason phrase: Invalid URI (400) [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.519 s [INFO] Finished at: 2025-03-21T23:58:44+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Plugin org.springframework.boot:spring-boot-maven-plugin:与 Spring Boot 版本一致 or one of its dependencies could not be resolved: [ERROR] The following artifacts could not be resolved: org.springframework.boot:spring-boot-maven-plugin:pom:与 Spring Boot 版本一致 (absent): org.springframework.boot:spring-boot-maven-plugin:pom:与 Spring Boot 版本一致 failed to transfer from https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.springframework.boot:spring-boot-maven-plugin:pom:与 Spring Boot 版本一致 from/to central (https://repo.maven.apache.org/maven2): status code: 400, reason phrase: Invalid URI (400) [ERROR] -> [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/PluginResolutionException
03-22
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值