Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central
问题:
maven安装完成,环境变量配置没有问题,cmd窗口运行mvn compile的时候报错如下:
Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved:
Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6:
Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.52.215] failed: Connection timed out: connect -> [Help 1]
解决方案:
1. 经红色字体可以得知,不能在https://repo.maven.apache.org/maven2这个网址下载到maven-resources-plugin:jar:2.6jar包,于是我浏览器访问了红色网址,可以访问的到。
2. 我把从其他地方得到的2.6的maven-resources-plugin jar包和pom相关文件放到maven指定的目录下,可是错误依旧,尝试失败。
3. 从网上搜到这种问题的解决方案之一:是在pom.xml中加入依赖如下,有些人用这个方法解决了问题,但是我的问题依旧。
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
</dependency>
4. 开始放大招了,最后搜索到一种方法,直接把maven安装文件夹的conf文件夹下的 settings.xml文件配置如下:
<mirrors>
<!-- maven官方镜像 -->
<mirror>
<id>mirrorId</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name </name>
<url>http://repo1.maven.org/maven2/</url>
</mirror>
<!-- 阿里云镜像1 -->
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://central.maven.org/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
<!-- 阿里云镜像2 -->
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
最后问题得以解决。这种问题出现的原因就是,联通的网段,无法访问maven.org网站。
最后感谢博主提供了答案:https://www.cnblogs.com/1446358788-qq/articles/9597877.html
Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central的更多相关文章
- 彻底解决Could not transfer artifact org.apache.maven.plugins问题
今天在学习maven框架的时候出现Could not transfer artifact org.apache.maven.plugins问题,后面根据很多博客综合总结,终于解决了,现在分享一下我的方 ...
- 【原创】大叔经验分享(10)Could not transfer artifact org.apache.maven:maven. from/to central. Received fatal alert: protocol_version
maven编译工程报错 [ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:3.2.2:add-source (s ...
- 在idea中新建完springboot项目的时候遇到问题(右键没有class选择;控制台报错:Could not transfer artifact org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.60 from/to central ....)
一.在idea中新建完springboot项目的时候遇到问题 问题1:右键没有class选择 解决:之所以会如此,是因为项目还没完成创建完成,解决:只需等等即可,等到完全创建完成即可 问题2(报tom ...
- Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from 这类问题的解决方法
最近换了台电脑,所以重新在IEDA上搭建Spring Boot环境,遇到一个问题,网上查了很久,又实践了一通,终于解决,这里把步骤详细记录下来. 问题描述:创建IDEA的Maven项目后,出现 Mav ...
- 解决Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.17 问题
详细报错如下 Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.17 from http://maven ...
- Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4
Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 from https://repo.mave ...
- 解决Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4
Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 from http://uk.maven.o ...
- 异常Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 from http://maven.aliyun.com/nexus/content/groups/public was ...
错误异常:Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 from http://maven ...
- maven报错 Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:3.5.0 from
maven报错误,类似于: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:3.5.0 from http ...
随机推荐
- 利用adb 打开手机应用程序
通过adb打开android应用,我们需要做的第一步,就是查看当前app的入口,第二部,就是通过命令启动我们的app入口 查看app的启动画面 在运行下面命令时,先启动想要通过adb打开的app #查 ...
- Linux Shell脚本编程提高(12)
实际上Shell是一个命令解释器,它解释由用户输入的命令并且把它们送到内核,不仅如此,Shell有自己的编程语言用于对命令的编辑,它允许用户编写由shell命令组成的程序.Shel编程语言具有普通编程 ...
- Select count(*)、Count(1)、Count(0)的区别和执行效率比较
记得很早以前就有人跟我说过,在使用count的时候要用count(1)而不要用count(*),因为使用count(*)的时候会对所有的列进行扫描,相比而言count(1)不用扫描所有列,所以coun ...
- 我的AI之路 —— 从裸机搭建GPU版本的深度学习环境
之前一直在CPU上跑深度学习,由于做的是NLP方向所以也能勉强忍受.最近在做图像的时候,实在是扛不住了...还好领导们的支持买个虚拟机先体验下.由于刚买的机器,环境都得自己摸索,瞎搞过很多次,也走过很 ...
- nginx root&alias 文件路径配置
nginx 指定文件路径有两种方式 root 和 alias,root 与 alias 主要区别在于 nginx 如何解释 location 后面的 uri,这会使两者分别以不同的方式将请求映射到服务 ...
- python学习笔记10-文件操作
能调用方法的一定是对象.文件本身也是一个对象.有很多自己内置的方法 #操作文件第一件事 建立文件对象 open函数 # 参数一:文件路径 绝对路径和相对路径都可以 # 参数二:模式选择 ‘r’ 读模式 ...
- 【learning】 扩展欧几里得算法(扩展gcd)和乘法逆元
有这样的问题: 给你两个整数数$(a,b)$,问你整数$x$和$y$分别取多少时,有$ax+by=gcd(x,y)$,其中$gcd(x,y)$表示$x$和$y$的最大公约数. 数据范围$a,b≤10^ ...
- alembic教程
安装 pip install alembic 步骤 1.初始化 alembic 仓库 在终端中, cd 到你的项目目录中,然后执行命令 alembic init alembic ,创建一个名叫 ale ...
- Math、Random、System、BigInteger、Date、DateFormat、Calendar类,正则表达式_DAY14
1:Math&大数据类四则运算 X abs(X x) double random() 产生随机数 double ceil(double a) 向上取整 double flo ...
- CentOS6.7-64bit编译hadoop2.6.4
1.下载maven(apache-maven-3.3.3-bin.tar.gz) http://archive.apache.org/dist/maven/maven-3/3.3.3/binaries ...