IDEA常见错误:程序包org.apache.commons.xxx不存在

文章讲述了在遇到无法从NexusRepositoryManager下载ApacheCommonsText的pom:1.1问题时,如何通过修改Maven的settings.xml文件,将镜像源切换至阿里云来解决。具体步骤包括打开并编辑settings.xml,添加或修改Nexus的镜像配置,并重新加载Maven以成功下载依赖到本地仓库。
摘要由CSDN通过智能技术生成

具体错误:

Could not transfer artifact org.apache.commons:commons-text:pom:1.1 from/to Nexus(Repository - Nexus Repository Manager

原因:

Nexus镜像源无法找到该程序包地址, 可更改镜像源及配置解决。

一、打开配置文件settings.xml

 二、修改镜像地址为阿里云

<mirror>
   	<id>nexus-aliyun</id>
    <mirrorOf>central</mirrorOf>
	<name>Nexus aliyun</name>
	<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
 </mirror>

三、修改配置文件

不修改会提示认证失败

<!-- 添加profile -->
 <profile>
 <id>jdk-1.8</id>
 <activation>
     <jdk>1.8</jdk>
 </activation>
 <repositories>
     <repository>
         <id>nexus</id>
         <name>local private nexus</name>
         <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
         <releases>
             <enabled>true</enabled>
         </releases>
         <snapshots>
             <enabled>false</enabled>
         </snapshots>
     </repository>
 </repositories>
 <pluginRepositories>
     <pluginRepository>
         <id>nexus</id>
         <name>local private nexus</name>
         <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
         <releases>
             <enabled>true</enabled>
         </releases>
         <snapshots>
             <enabled>false</enabled>
         </snapshots>
     </pluginRepository>
 </pluginRepositories>
 </profile>

四、重新加载maven,成功下载架包到本地仓库

 

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值