网上关于maven怎么配置本地仓和镜像的方法有很多,我就不说了。说一个我自己碰到的问题。
问题是这样的,我按照网上的办法配置本地仓,镜像(https://www.cnblogs.com/liunanjava/archive/2015/11/05/4936037.html),使用 mvn help:system还是报错,不能下载包。但是在公司按照同样的办法配置却可以。
最后发现问题的原因是:10106被占用。请记住这个端口(这个端口好像是不能通过重启电脑来解除占用的)
解决办法:
1,以管理员身份打开命令提示符
2,输入 netsh winsock reset
3,重启电脑就ok了
可能导致问题出现的原因:
执行mvn help:system时出错,导致该端口一直被占用,等你修改完再进行同样操作时就不能使用端口访问中央库了,导致提示
Downloading from Central: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.5: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5
Downloading from Central: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.4/maven-install-plugin-2.4.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-install-plugin:2.4: Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-install-plugin:jar:2.4
Downloading from Central: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-deploy-plugin/2.7/maven-deploy-plugin-2.7.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-deploy-plugin:2.7: Plugin org.apache.maven.plugins:maven-deploy-plugin:2.7 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-deploy-plugin:jar:2.7
.
.
.
.
这种错误。