如何修复或解决旅行车错误? [英] How to fix or workaround wagon bug?
问题描述
错误 https://issues.apache.org/jira/browse/MDEPLOY-177 已经打了我好几个月了.当 maven 尝试下载工件时,它会停止并显示一条消息说正在下载
Bug https://issues.apache.org/jira/browse/MDEPLOY-177 has been hitting me for many month. When maven tries to download artifacts it will stall with a message saying it is downloading
x+1 of x B
例如
1007/1006 B
然后它挂起.Robert Scholte 曾多次尝试在这方面提供帮助,但到目前为止都无济于事.在我的多平台环境中,我偶尔会看到错误在 Eclipse 环境中或直接在 Mac OSX macports 上或最近使用 Ubuntu 14.04 LTS 时出现.
and then it hangs. Robert Scholte tried to help on this quite a few times but so far to no avail. In my multiplatform environment I every once in a while see the bug creeping up be it in an Eclipse environment or directly on Mac OSX macports or just recently with Ubuntu 14.04 LTS.
我怎样才能彻底摆脱这个问题?
这些是我目前所知道的建议:
These are suggestions I know of so far:
- 替换旅行车版本
- 直接使用 wagon-ssh
- 首先要使用更新的 mvn 版本.
- 选择不同的货车供应商
对于其中的每一个,我都不知道如何做这些事情.
For each of these I do not have a clue how to do these things.
**对于#1:替换旅行车版本**
**for #1: replace the wagon version **
例如罗伯特·肖尔特写道:Wolfgang Fahl,你能从这个问题开始的时候缩小到 ssh-wagon 的版本吗?你可以通过下载那个 jar 并将它放在 apache-maven-3.2.3/lib/ext 来做到这一点"
E.g. Robert Scholte wrote: "Wolfgang Fahl, could you narrow it down to the version of the ssh-wagon since when this issue starts? You can do it by downloading that jar and put it in apache-maven-3.2.3/lib/ext"
但是那个位置在哪里,例如Eclipse/MacPorts/Ubuntu?
But where would that location be in e.g. Eclipse / MacPorts / Ubuntu?
这是我在 Ubuntu 14.04 LTS 机器上的:
This is what I have on the Ubuntu 14.04 LTS machine:
muf@capri:/usr/share/maven/lib$ ls -l | grep wagon
lrwxrwxrwx 1 root root 37 Oct 30 2013 aether-connector-wagon.jar -> ../../java/aether-connector-wagon.jar
lrwxrwxrwx 1 root root 29 Oct 30 2013 wagon-file.jar -> ../../java/wagon-file-2.x.jar
lrwxrwxrwx 1 root root 36 Oct 30 2013 wagon-http-shaded.jar -> ../../java/wagon-http-shaded-2.x.jar
lrwxrwxrwx 1 root root 37 Oct 30 2013 wagon-provider-api.jar -> ../../java/wagon-provider-api-2.x.jar
在/usr/share/java 中有:
in /usr/share/java there are:
muf@capri:/usr/share/java$ ls -l wagon-ssh*
lrwxrwxrwx 1 root root 13 Apr 24 2012 wagon-ssh-1.0.jar -> wagon-ssh.jar
lrwxrwxrwx 1 root root 17 Nov 1 2013 wagon-ssh-2.x-2.5.jar -> wagon-ssh-2.x.jar
-rw-r--r-- 1 root root 24033 Nov 1 2013 wagon-ssh-2.x.jar
lrwxrwxrwx 1 root root 20 Apr 24 2012 wagon-ssh-common-1.0.jar -> wagon-ssh-common.jar
lrwxrwxrwx 1 root root 24 Nov 1 2013 wagon-ssh-common-2.x-2.5.jar -> wagon-ssh-common-2.x.jar
-rw-r--r-- 1 root root 20532 Nov 1 2013 wagon-ssh-common-2.x.jar
-rw-r--r-- 1 root root 21913 Apr 24 2012 wagon-ssh-common.jar
lrwxrwxrwx 1 root root 25 Apr 24 2012 wagon-ssh-common-test-1.0.jar -> wagon-ssh-common-test.jar
-rw-r--r-- 1 root root 6131 Apr 24 2012 wagon-ssh-common-test.jar
lrwxrwxrwx 1 root root 22 Apr 24 2012 wagon-ssh-external-1.0.jar -> wagon-ssh-external.jar
lrwxrwxrwx 1 root root 26 Nov 1 2013 wagon-ssh-external-2.x-2.5.jar -> wagon-ssh-external-2.x.jar
-rw-r--r-- 1 root root 9953 Nov 1 2013 wagon-ssh-external-2.x.jar
-rw-r--r-- 1 root root 9718 Apr 24 2012 wagon-ssh-external.jar
-rw-r--r-- 1 root root 23603 Apr 24 2012 wagon-ssh.jar
对于#2:到目前为止,我没有找到相关说明.
for #2: I didn't find instructions for this so far.
对于 #3:
对于明显的更当前的 mvn",我必须知道哪个 maven 附带的货车不再有错误.直到 3.3.1 错误都在那里,例如在 Mac OS X 上.
For the obvious "more current mvn" I'd have to know which maven ships with a wagon that does not have the bug any more. Up to 3.3.1 the bug was there e.g. on Mac OS X.
对于#4:https://maven.apache.org/guides/mini/guide-wagon-providers.html有关于更改提供程序的说明 - 它没有说明您如何更改提供程序的版本
for #4: https://maven.apache.org/guides/mini/guide-wagon-providers.html has instructions on changing the provider - it does not say how you change the version of a provider
到目前为止,降级到 mvn 3.0.5 已经奏效.但不幸的是,在 Ubuntu 14.04 LTS 中,这只是例如可在 Macports 上使用 - 但在那里不行!
So far downgrading to mvn 3.0.5 had worked. But unfortunately in Ubuntu 14.04 LTS that is just the version that e.g. works on Macports - but there it does not!
推荐答案
在主 pom.xml 中指定 wagon-ssh 2.10 修复了该问题.2.7 坏了 2.9 可能坏了.
specifying wagon-ssh 2.10 in the master pom.xml fixes the issue. 2.7 was broken 2.9 might be broken.
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>2.10</version>
</extension>
</extensions>
</build>
这篇关于如何修复或解决旅行车错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!