mvn install失败:Failed to read artifact descriptor org.apache.maven.plugins:maven-install-plugin:jar:2
来源:互联网 发布:js缺省参数 编辑:程序博客网 时间:2024/06/05 23:42
之前一直用笔记本开发,今天把台式机环境搞好了,从git拉了工程,maven工程install出现错误,详情:
[INFO] Scanning for projects...[INFO] Downloading from nexus: http://maven.aliyun.com/nexus/content/groups/public/com/bonc/ti/ti-parent/1.0.6-SNAPSHOT/maven-metadata.xml[WARNING] Could not transfer metadata com.bonc.ti:ti-parent:1.0.6-SNAPSHOT/maven-metadata.xml from/to nexus (http://maven.aliyun.com/nexus/content/groups/public/): Operation not supported: connect[INFO] [INFO] ------------------------------------------------------------------------[INFO] Building vbap data model 3.0.7-SNAPSHOT[INFO] ------------------------------------------------------------------------[INFO] Downloading from nexus: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-install-plugin/2.5.2/maven-install-plugin-2.5.2.pom[INFO] ------------------------------------------------------------------------[INFO] BUILD FAILURE[INFO] ------------------------------------------------------------------------[INFO] Total time: 1.307 s[INFO] Finished at: 2017-12-19T19:50:31+08:00[INFO] Final Memory: 15M/155M[INFO] ------------------------------------------------------------------------[ERROR] Plugin org.apache.maven.plugins:maven-install-plugin:2.5.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-install-plugin:jar:2.5.2: Could not transfer artifact org.apache.maven.plugins:maven-install-plugin:pom:2.5.2 from/to nexus (http://maven.aliyun.com/nexus/content/groups/public/): Operation not supported: connect -> [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显示在不能从仓库传输maven-install-plugin:2.5.2插件,因为maven的install操作的时候是通过maven-install-plugin插件执行的,首先要保证install插件的存在。
http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
可以看到造成PluginResolutionException这个异常的原因有6个:2.访问的插件是一个没有发布到中央库的第三方插件,但是你的pom文件或者settings.xml文件中没有<pluginRepository>
标签指明从该仓库下载插件。这里要注意的一点是,<repository>
定义在查找插件及其依赖的时候是不起作用的,仅<pluginRepository>
对插件的下载起作用。
3.插件仓库需要权限验证,但是Maven没有通过权限验证,所以访问不了仓库服务器,所以这时候应该去看settings.xml文件中的<server>
定义:
<server> <!-- server(服务器)的id,对应着mirrors中的id,指定了该地址的验证信息 --> <id>nexus</id> <username>xxx</username> <password>xxx</password></server>4.网络问题,比如说有的地址需要vpn才能访问,那就需要代理配置等。settings.xml文件中设置代理:
<proxies> <proxy> <id>optional</id> <active>true</active> <protocol>http</protocol> <host>代理的ip地址</host> <port>端口</port> </proxy></proxies>LocalRepositoryNotAccessibleException 了解更多信息。
6.配置的插件仓库对你需要的插件的不可见的,比如说我要访问一个SNAPSHOT快照版本的插件,在正式仓库中就无法访问到,这个时候应该检查settings.xml文件中的插件仓库配置:
<pluginRepositories> <pluginRepository> <id>central</id> <url>http://central</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository></pluginRepositories>
在错误中显示了Operation not supported: connect
这样的错误,表示连接maven仓库的操作不支持?看不懂。
说连接有问题,我能下载其他的依赖包说明是没问题的。然后就去看settings.xml文件的配置项,也没有什么问题。
1.右击工程-> maven -> update-project -> 勾选force to update snapshot/release -> OK
2.把.m2/下所有的文件删除,重新下载一遍。
3.把settings.xml文件copy一份到.m2/文件夹下。
4.检查eclipse中的settings文件配置:Windows->preferences->maven->User Settings
我回到eclipse中右击工程update project,发现不行,然后把settings.xml文件copy一份到了.m2/文件夹下,运行mvn install 还是报错,气得我重启了一波电脑,居然就成功了!!!
参考链接:
http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
https://stackoverflow.com/questions/18728792/failed-to-read-artifact-descriptor-for-artifact-present-in-my-localhost-nexus-re
https://stackoverflow.com/questions/10729394/artifactdescriptorexception-failed-to-read-artifact-descriptor-maven-error
如果还有相关的问题可以参考:
https://stackoverflow.com/questions/12533885/could-not-calculate-build-plan-plugin-org-apache-maven-pluginsmaven-resources
https://stackoverflow.com/questions/6642146/maven-failed-to-read-artifact-descriptor
- mvn install失败:Failed to read artifact descriptor org.apache.maven.plugins:maven-install-plugin:jar:2
- Failed to read artifact descriptor for org.apache.maven.plugins:maven-jar-plugin:jar:2.5
- Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.7
- Failed to read artifact descriptor for org.apache.maven.plugins:maven-war-plugin:2.3
- PluginResolutionException( Failed to read artifact descriptor for org.apache.maven.plugins:)
- [ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install (default-in
- maven install Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war
- maven install时Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.5:test
- maven install时报错Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
- maven install时报错Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
- maven install时报错Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
- maven install时报错Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
- maven install时报错Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
- maven install时报错Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
- maven install时报错Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile,
- maven install时报错Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
- maven install时报错Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
- maven install时报错Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
- 使用Redis SETNX 命令实现分布式锁
- Java HashMap源码解析 不是COPY
- 安卓事件格式化不正确问题
- 图解正向代理、反向代理、透明代理
- 白帽子讲web安全笔记-3.2.6.4 window.name的妙用
- mvn install失败:Failed to read artifact descriptor org.apache.maven.plugins:maven-install-plugin:jar:2
- 比较a^b与b^a的大小
- 12.20 路径跳转问题
- Castle Windsor 文档
- nginx五 之高可用
- zooKeeper单机版安装及设置
- Ubuntu16.04下安装Wechat
- java添加水印
- ES6新特性—CLass类