我有一个本地 Artifact 存储库,我的 maven 设置指向它,但由于某种原因,这似乎没有成功,并且在尝试安装时一直失败。 我可以直接在浏览器中访问 url,也可以通过浏览器访问 maven repo。 我也可以 ping 两者。
知道为什么它总是失败吗? 下面的堆栈跟踪
干杯,
mvn clean install -DskipTests -T 8C
[INFO] Scanning for projects...
Downloading: http://repo1.maven.org/maven2/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.pom
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project uk.co.three:Three:0.1 (/Users/***/Projects/three/Development/pom.xml) has 1 error
[ERROR] Unresolveable build extension: Plugin org.apache.maven.wagon:wagon-webdav:1.0-beta-2 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.wagon:wagon-webdav:jar:1.0-beta-2 (): Failed to read artifact descriptor for org.apache.maven.wagon:wagon-webdav:jar:1.0-beta-2: Could not transfer artifact org.apache.maven.wagon:wagon-webdav:pom:1.0-beta-2 from/to central (http://repo1.maven.org/maven2): Error transferring file: Connection refused -> [Help 2]
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
最佳答案
我不知道您使用的是嵌入式还是外部 maven 安装(Window-> Preferences -> Maven -> Installations)。
如果它是外部的,您必须在 settings.xml
中声明您的公司代理(在外部安装的 conf 文件夹中或在本地存储库中)。
如果你使用内嵌的maven也可能是这样。然后你必须在“嵌入式安装的全局设置”中提供一个设置文件。
如果您使用的是外部 maven 安装,您还可以在 eclipse 外部尝试命令行。
与
mvn -U ...
您可以强制 maven 查找最新的插件版本。
关于java - Maven 构建依赖项失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18590506/