我在没有互联网访问权限的服务器上运行Jenkins构建。必须从nexus代理存储库下载所有工件。它很好,从代理下载了数十个罐子,直到maven尝试从中央下载已下载的工件。在日志的某些行下面:
[INFO] Downloading: http://{mynexus}/nexus/content/groups/{myrepo}/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
. . .
[INFO] Downloaded: http://{mynexus}/nexus/content/groups/{myrepo}/commons-lang/commons-lang/2.6/commons-lang-2.6.jar (278 KB at 3118.6 KB/sec)
. . .
[INFO] Downloaded: http://{mynexus}/nexus/content/groups/{myrepo}/com/google/guava/guava/10.0.1/guava-10.0.1.jar (1467 KB at 23275.9 KB/sec)
[INFO] Downloading: http://repo.maven.apache.org/maven2/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook
[WARNING] Failed to getClass for org.codehaus.mojo.sonar.SonarMojo
它甚至没有尝试首先检查配置的存储库,并且刚刚从代理下载了工件。我想知道最后两行意味着什么,这不是正常的'无法转移神器'失败的消息。在日志的下方:
Waiting for Jenkins to finish collecting data[ERROR] Failed to execute goal
org.codehaus.mojo:sonar-maven-plugin:2.5:sonar (default-cli) on project XXX:
Execution default-cli of goal org.codehaus.mojo:sonar-maven-plugin:2.5:sonar failed:
Plugin org.codehaus.mojo:sonar-maven-plugin:2.5 or one of its dependencies could not be resolved:
Could not transfer artifact commons-lang:commons-lang:jar:2.6 from/to central (http://repo.maven.apache.org/maven2):
Connect to repo.maven.apache.org:80 [repo.maven.apache.org/23.235.43.215] failed: Connection timed out: connect -> [Help 1]
答案 0 :(得分:0)
如果您有类似
的内容,就会导致此类行为@ToString(exclude="#classname")
public class SomeClass { ... }
在您的settings.xml中。
要强制maven使用你的镜子而只使用你的镜子,你必须写
<mirrorOf>repositoryId</mirrorOf>
在您的settings.xml中