Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/378.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Maven在中央存储库上超时-无代理设置-Windows_Java_Maven - Fatal编程技术网

Java Maven在中央存储库上超时-无代理设置-Windows

Java Maven在中央存储库上超时-无代理设置-Windows,java,maven,Java,Maven,Maven在尝试清理项目时会拖延时间 USER>mvn clean 此命令后,生成抛出: [ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dep endencies could not be resolved: Failed to read artifact descriptor for org.apac he.maven.plugins:maven-clean-plugin:jar

Maven在尝试清理项目时会拖延时间

USER>mvn clean
此命令后,生成抛出:

[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dep
endencies could not be resolved: Failed to read artifact descriptor for org.apac
he.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apa
che.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven
.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org
/23.235.46.215] failed: Connection timed out: connect -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResoluti
onException

在${HOME}/.m2/
settings.xml(或pom.xml)中是否配置了其他存储库?如果是这样,请确保其中没有一个id为
central
,否则您可能已重新配置了maven central的位置

此外,如果您使用本地托管的“代理”maven存储库,请不要重新配置
central
以指向本地托管的maven存储库,而是使用“mirror”指令,将存储库配置为id类似“localrepo”的内容,并将其指定为“mirrorOf”
central

最后,避免任何“代理”设置,除非您希望所有搜索都开始搜索网络之外的存储库(即internet上的存储库)

Maven以一种非常特殊的方式管理依赖关系,这提供了构建的重复能力。基本上,它需要在pom.xml中编码。是的,您可以通过使用命令行来实现这些功能,但是如果您这样做,那么您就违背了maven的设计(同时剥夺了它的大部分实用性)


如果你需要一些东西来“更新”一个版本,那么就考虑编写一个脚本来更新和检查POM.XML中的工件,或者(不太理想的)将依赖关系建立在快照版本上。

你可以<代码> ping <代码> >代码> ReP.Maven?Apache?org < /代码>?如果是,您可以通过浏览器访问它吗?23.235.46.215的Ping统计数据:数据包:发送=4,接收=4,丢失=0(0%丢失),那么浏览器呢?Via-HTTPSIt正在工作,但我需要从命令行注入依赖项。在这种情况下,我不确定是什么导致了这种情况。您可能无意中打开了代理,或者您可能有防火墙阻止特定应用程序(在本例中为Maven)访问特定网站。我的计算机中没有代理设置,它是新的,而且是个人的。