maven联通网络下中央仓库不能访问的解决办法

最近刚开始学习maven工具,下载解压完毕,环境变量配置完毕,运行如下命令尝试快速构建一个maven项目:

mvn archetype:generate

结果就有问题:

[INFO] Scanning for projects...
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.4.1: Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.3.1/maven-install-plugin-2.3.1.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-install-plugin:2.3.1: Plugin org.apache.maven.plugins:maven-install-plugin:2.3.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-install-plugin:jar:2.3.1
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-deploy-plugin/2.5/maven-deploy-plugin-2.5.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-deploy-plugin:2.5: Plugin org.apache.maven.plugins:maven-deploy-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-deploy-plugin:jar:2.5
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-site-plugin/2.0.1/maven-site-plugin-2.0.1.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-site-plugin:2.0.1: Plugin org.apache.maven.plugins:maven-site-plugin:2.0.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-site-plugin:jar:2.0.1
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-antrun-plugin/1.3/maven-antrun-plugin-1.3.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-antrun-plugin:1.3: Plugin org.apache.maven.plugins:maven-antrun-plugin:1.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-antrun-plugin:jar:1.3
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-assembly-plugin/2.2-beta-5/maven-assembly-plugin-2.2-beta-5.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5: Plugin org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-assembly-plugin:jar:2.2-beta-5
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-dependency-plugin/2.1/maven-dependency-plugin-2.1.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-dependency-plugin:2.1: Plugin org.apache.maven.plugins:maven-dependency-plugin:2.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-dependency-plugin:jar:2.1
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-release-plugin/2.0/maven-release-plugin-2.0.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-release-plugin:2.0: Plugin org.apache.maven.plugins:maven-release-plugin:2.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-release-plugin:jar:2.0
Downloading: http://repo1.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (http://repo1.maven.org/maven2): Error transferring file: Connection timed out: connect
[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (http://repo1.maven.org/maven2): Error transferring file: Connection timed out: connect
Downloading: http://repo1.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (http://repo1.maven.org/maven2): Error transferring file: Connection timed out: connect
[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (http://repo1.maven.org/maven2): Error transferring file: Connection timed out: connect
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3:30.786s
[INFO] Finished at: Sun Jul 08 15:55:29 CST 2012
[INFO] Final Memory: 2M/121M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'archetype' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (D:\project\.mave_repo\repo), central (http://repo1.maven.org/maven2)] -> [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/NoPluginFoundForPrefixException

 

这种hello world级别的操作出错,就怀疑是网络问题,于是让其他同事帮我尝试访问http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom地址,发现完全没问题,感觉异常郁闷。后来网上查了一下,发现是因为联通网络下,无法访问maven.org网站。解决此问题理论上有两个办法,一个是在maven的配置文件中设置代理,另一个是在maven的配置文件中设置联通网络下,能够访问的中央仓库的mirrors。因为也不好找稳定的代理,我就在网上搜索了两个可用的mirror站点,配置方式如下:

1、打开maven配置文件(maven安装目录下的conf目录下的settings.xml文件)

2、搜索mirrors关键字,如果注释说明的下方没有  <mirrors>节点,则建立mirrors节点,带mirrors节点的所有配置如下(复制下面的内容,粘贴到配置文件中即可):

   <mirrors>
    <!-- mirror
     | Specifies a repository mirror site to use instead of a given repository. The repository that
     | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
     | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
     |
    <mirror>
      <id>mirrorId</id>
      <mirrorOf>repositoryId</mirrorOf>
      <name>Human Readable Name for this Mirror.</name>
      <url>http://my.repository.com/repo/path</url>
    </mirror>
    -->
     <mirror> 
           <id>ibiblio.org</id> 
           <name>ibiblio Mirror of http://repo1.maven.org/maven2/</name> 
           <url>http://mirrors.ibiblio.org/pub/mirrors/maven2</url> 
           <mirrorOf>central</mirrorOf> 
           <!-- United States, North Carolina --> 
     </mirror>
     <mirror>  
         <id>jboss-public-repository-group</id>  
         <mirrorOf>central</mirrorOf>  
         <name>JBoss Public Repository Group</name>  
         <url>http://repository.jboss.org/nexus/content/groups/public</url>  
     </mirror>  
        
  </mirrors>

机器学习——径向基函数(RBF)神经网络 目录 一、什么是基函数 二、什么是径向基函数 三、为什么RBF神经网络使用一个径向基函数作为隐含层的激活函数 四、参数训练 五、RBF网络vs BP网络和 SVM 一、什么是基函数 著名的傅里叶变换是指:n个有参(权值)的正、余弦三角函数基的和式可以等价的表示任意一个周期函数,这里的“基”和我们数学中说的坐标基或向量基含义相同,即坐标空间中任意一个向量都可以用基向量的线性和表示出来。 因此,我们引入函数空间的概念,函数空间中的每个连续函数可以表示为基函数的线性组合,就像向量空间中的每.. 阅读详情

相关推荐

Altium Designer 20/21/22/23版本汉化与库管理全攻略(附避坑指南)

本文系统梳理了Altium Designer 20/21/22/23等多个版本的汉化方案与库管理全流程。针对不同版本的中文支持差异,提供了安全的汉化设置指南与版本选择建议。重点详解了原理图库、PCB封装库及集成库的创建、管理与团队协作最佳实践,并附有常见问题避坑指南,帮助硬件工程师高效搭建稳定的设计环境。

rgv234567的博客 1109

Failed to retrieve plugin descriptor for org.apache.maven.plugins错误解决方法

是用maven创建project时碰到下面的错误: D:\codes\JSF>mvn archetype:create -DgroupId=com.tutorialspoint.test -DartifactId =helloworld -DarchetypeArtifactId=maven-archetype-webapp [INFO] Scanning for projects...

1万+

VScode远程连接开发嵌入式开发板

VScode远程连接开发调试嵌入式开发板

qq_53221728的博客 5891

Maven安全代理设置引起的Failed to retrieve plugin descriptor for org.apache.maven.plugins……

Maven安全代理设置引起的Failed to retrieve plugin descriptor for org.apache.maven.plugins……问题,可以通过使用国内源和使用代理解决 1. Maven安装目录下的配置文件 当maven无法正常访问网络时候,需要通过代理进行访问 找到Maven的setting.conf文件 2. 修改配置 在安装目录路径下:/usr/local/apache-maven-3.6.3/conf# vim settings.xml 修改镜像mirrors属性

weixin_42310458的博客 2847

当GO.db安装失败时,生物信息学新手应该知道的5个底层逻辑

本文为生物信息学新手提供了解决GO.db安装失败的5个关键底层逻辑,包括网络连接与镜像源设置、版本兼容性检查、依赖关系管理、SQLite存储机制理解以及调试技巧。特别针对Bioconductor的GO.db包安装问题,详细介绍了如何通过切换国内镜像、管理版本冲突和解决依赖问题来成功安装,帮助用户高效克服常见安装障碍。

weixin_29062823的博客 407

DL-FWI基础入门培训视频学习1、2

DL-FWI基础知识

shengMio的博客 708

MAVEN安全代理设置引起的“[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:...”

[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin... 用Maven 命令创建一个简单的Maven项目时,有如下提示: Downloading: http://repo.maven.apache.org/maven2/org/apache/mave

做好自己 1万+

【论文复现】HiDDeN:Hiding Data With Deep Networks

(标签)是 float 类型,但代码中传入的是 long 类型(整数标签)。函数参数解析方式变化,导致无法正确保存生成的图像结果。这是因为新版torchvision的。使用预训练模型进行隐写和提取测试。HiDDeN支持多种噪声层组合。打印变量的类型,分别是。

qq_69146676的博客 971

解决联通网络环境下无法访问Maven中央仓库问题

解决无法访问Maven中央仓库:http://repo1.maven.org/maven2/org/apache/问题办法:当前,中国联通宽带屏蔽了Maven中央库http://repo1.maven.org/maven2/域名IP地址,但电信可以正常访问,从美国服务器测试可以.解决办法在Maven的配置文件里加Mirror:&lt;mirrors&gt;    &lt;!-- mirror   ...

SpringsSpace 998

wps js宏获取工作簿、工作表、单元格的值、链接转图片、单元格区域数据转二维数组、保存工作簿的常用Excel操作

wps js宏入门看这里,我写了常用的js操作Excel的方法:获取工作簿对象、获取工作表对象、获取单元格的值、链接转图片、生成条形码图片、单元格区域数据转二维数组方法、保存工作簿、弹出输入框、YesNo选择框,助你从VBA转战JS。

huaermeier的博客 3万+

python全栈入门到实战【基础篇 02】环境搭建:Python解释器与PyCharm、VSCode编辑器安装配置详解

本文详解Python环境搭建步骤。首先安装解释器(运行代码核心),需从官网下载,选3.8及以上版本(勿选2.x)。Windows安装必勾“Add Python.exe to PATH”,验证用`python --version`;Mac选universal2安装包,验证用`python3 --version`。 编辑器二选一:PyCharm社区版(免费,新手推荐),安装后需配置解释器路径;VSCode轻量,需装Python插件并选择解释器。

那些看似不起波澜的日复一日,会在某天让你看到坚持的意义 5万+

maven联通网络不能访问中央仓库

我在cmd中执行: D:\java\maven\repository>mvn archetype:create -DgroupId=com.ocean.maven -DartifactId=simple -DarchetypeArtifactId=maven-archetype-quickstart 报错信息如下: D:\java\maven\repository>mvn ...

weixin_30758821的博客 674

21天教你学会PCIe专栏(14)--安全性考虑

1.1 定义安全性(Security):安全性是指保护系统免受未经授权的访问、攻击和破坏,确保数据的机密性、完整性和可用性。1.2 重要性数据保护:保护敏感数据,防止数据泄露和篡改。系统防护:防止恶意攻击,确保系统的稳定性和可靠性。合规性:满足行业标准和法律法规的要求,避免法律风险。用户信任:提高用户对系统的信任度,增强市场竞争力。通过今天的学习,你应该对PCIe安全性的重要性和常见威胁有了深入的了解,掌握了实施安全措施的方法和工具,以及安全开发的最佳实践。

xiaoheshang_123的博客 850

maven中央仓库不能访问的解决办法

网上查了一下,无法访问maven.org网站的解决此问题理论上有两个办法,一个是在maven的配置文件中设置代理,另一个是在maven的配置文件中设置联通网络下,能够访问的中央仓库的mirrors。导入Maven项目,编译时候出错,好象是接不上apache.org/maven2,下载不了maven-resources-plugin-2.6.jar 这个jar包。1、打开maven配置文件(maven安装目录下的conf目录下的settings.xml文件)但是这两个也不好用,在这里。找到开源中国的资源库,

m0_67402125的博客 3083

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

maven 中央仓库 无法访问

mvn构建工程时,编译提示如下错误 : 1、 Connect to repo.maven.apache.org:443. 2、 Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar. 3、 Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar. 其原因是无法访问m

bhegi_seg的博客 6630

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

Maven配置文件中 mirror和repository的区别及中央仓库配置大全

1、Maven配置文件中 mirror和repository的区别 1.1 repository repository就是个仓库,maven里有两种仓库,Local Repository(本地仓库)和Remote Repository(远程仓库)。 1.1.1 Remote Repository(远程仓库)主要有3种 中央仓库:http://repo1.maven.org/maven2/ 私服...

XING_Gou的博客 2413

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

联通网络环境上无法访问http://repo1.maven.org/maven2/中央库解决,镜像库添加

联通网络环境下无法访问http://repo1.maven.org/maven2/中央库解决,镜像库添加 Maven 2的安装和使用虽然不是一点即用,但也不是很复杂。然而,这两天我新装Maven,刚刚过了mvn -version,尝试create maven project就出问题了。问题详情如下。发现联通宽带屏蔽了中央库http://repo1.maven.org/maven2/ 域名IP地址

white__cat的专栏 1549

Unresolveable build extension: Plugin...or one of its dependencies could not be resolved: Failed to

今天在公司的时候从github上下东西还好好的,回到家执行同样的命令就报错: [ERROR] [ERROR] Some problems were encountered while processing the POMs: [ERROR] Unresolveable build extension: Plugin org.sonatype.plugins:nexus-staging-maven...

pp814274513的专栏 4665
上一篇: maven报错
下一篇: Python中的and和or
java_doom
博客等级 码龄20年 6粉丝 199原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值