从Github检出Mina(maven)项目出现问题解决过程

Maven依赖包问题解决-could not resolve artifact/Missing artifact:[url]http://donald-draper.iteye.com/blog/2317801[/url]
今天从github检出maven管理的Mina项目时出现以下问题,写篇文章记录一下,希望能够遇到相同问题的网友,一点帮助。
[b]1.首先从github中找到项目的地址:[/b]

[img]http://dl2.iteye.com/upload/attachment/0124/9903/ebe241b6-bddb-3031-9d66-5caec2f0fd8c.png[/img]

[url]https://github.com/apache/mina.git[/url]
[b]
2.用eclipse检查的Mina的Maven项目时pom.xml文件出现以下问题:[/b]
a.
Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4
from https://repo.maven.apache.org/maven2 was cached in the local repository,
resolution will not be reattempted until the update interval of central has
elapsed or updates are forced. Original error: Could not transfer artifact
org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 from/to central
(https://repo.maven.apache.org/maven2): The operation was cancelled.
[color=red]问题:无法下载maven-surefire-plugin-2.12.4.jar[/color]


b.
CoreException: Could not get the value for parameter compilerId for plugin execution default-compile:
PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or
one of its dependencies could not be resolved:
The following artifacts could not be resolved:
com.google.collections
:google-collections:jar:1.0,
junit:junit:jar:3.8.2:
Failure to transfer com.google.collections:google-collections:jar:1.0
from https://repo.maven.apache.org/maven2 was cached in the local repository,
resolution will not be reattempted until the update interval of central has elapsed or
updates are forced. Original error: Could not transfer artifact com.google.collections:
google-collections:jar:1.0 from/to central (https://repo.maven.apache.org/maven2):
The operation was cancelled.
[color=red]问题:org.apache.maven.plugins:maven-compiler-plugin:3.1依赖无法解决,主要是
com.google.collections:google-collections:jar:1.0,
junit:junit:jar:3.8.2:
这两个包有问题[/color]


上面两个问题主要是jar包,自动下载失败的原因,可能网络或其他原因:
[b]解决方式:[/b]
1.先删除相应的mvn本地仓库中对应jar包的文件夹的文件;(这个一定要做,里面有记录下载jar失败的本地缓存文件)
2.到maven中心仓库下载相应的jar包([url]http://search.maven.org/[/url]);
3.dos下,进入下载jar的目录下:
4.执行以下命令
mvn install:install-file -Dfile=fgoogle-collections-1.0.jar -DgroupId=com.google.collections -DartifactId=google-collections -Dversion=1.0 -Dpackaging=jar
mvn install:install-file -Dfile=junit-3.8.2.jar -DgroupId=junit -DartifactId=junit -Dversion=3.8.2 -Dpackaging=jar
mvn install:install-file -Dfile=maven-surefire-plugin-2.12.4.jar -DgroupId=org.apache.maven.plugins -DartifactId=maven-surefire-plugin -Dversion=2.12.4 -Dpackaging=jar
注意:这里的groupId,artifactId,到maven仓库中jar的对应的pom.xml中找,这个不能错,
命令的使用,可以查看文章引入链接;
5.更新Maven项目(maven-》update project)。

附:
maven中心仓库地址:[url]http://search.maven.org/[/url]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值