Jenkins构建已经开始失败,错误如下:
Caused by: org.apache.maven.artifact.resolver.ArtifactResolutionException:
Unable to get dependency information: Unable to read the metadata file for
artifact 'commons-beanutils:commons-beanutils:jar': Error getting POM for
'commons-beanutils:commons-beanutils' from the repository: Unable to read
local copy of metadata: Cannot read metadata from
'/usr/share/tomcat5/.m2/repository/commons-beanutils/commons-
beanutils/1.9.3-SNAPSHOT/maven-metadata-codehaus.org.xml': end tag name
</body> must match start tag name <hr> from line 7 (position: TEXT seen ...
</address>\n</body>... @9:8)
commons-beanutils:commons-beanutils:pom:1.9.3-SNAPSHOT
根据我的理解或我所做的调试,我会将codehaus repo从http迁移到https,如主页上所示:https://www.codehaus.org/termination-503.html
一些调试日志:
`[DEBUG] Skipping disabled repository codehaus.org
[INFO] artifact commons-beanutils:commons-beanutils: checking for updates from activiti-repo
[DEBUG] Using Wagon implementation lightweight from default mapping for protocol https
[DEBUG] Checking for pre-existing User-Agent configuration.
[DEBUG] Adding User-Agent configuration.
[DEBUG] Connecting to repository: 'activiti-repo' with url: 'https://maven.alfresco.com/nexus/content/groups/public'.
[DEBUG] Using Wagon implementation lightweight from default mapping for protocol https
[DEBUG] repository metadata for: 'artifact commons-beanutils:commons-beanutils' could not be found on repository: activiti-repo
[DEBUG] commons-beanutils:commons-beanutils:jar:1.9.3-SNAPSHOT:runtime (setting version to: 1.9.3-SNAPSHOT from range: [1.4,))
[DEBUG] Skipping disabled repository central
[DEBUG] Skipping disabled repository central
[INFO] snapshot commons-beanutils:commons-beanutils:1.9.3-SNAPSHOT: checking for updates from activiti-repo
[DEBUG] Using Wagon implementation lightweight from default mapping for protocol https
[DEBUG] Checking for pre-existing User-Agent configuration.
[DEBUG] Adding User-Agent configuration.
[DEBUG] Connecting to repository: 'activiti-repo' with url: 'https://maven.alfresco.com/nexus/content/groups/public'.
[DEBUG] Using Wagon implementation lightweight from default mapping for protocol https
[DEBUG] repository metadata for: 'snapshot commons-beanutils:commons-beanutils:1.9.3-SNAPSHOT' could not be found on repository: activiti-repo`
目前我正在使用maven2,但尝试了maven3,它也失败了。有什么建议可以解决吗?
答案 0 :(得分:2)
对于任何面临类似问题的人(maven 2.2,jdk 1.6,Jenkins和上面的错误)。我们需要添加镜像以确保对codehaus repo的请求被路由到备用位置。
<mirrors>
<mirror>
<mirrorOf>codehaus.org,codehaus,codehaus-repository,codehaus-snapshot</mirrorOf>
<name>remote-repos-mirror</name>
<url>http://my-nexusorartifactory/remote-repos</url>
<id>remotes</id>
</mirror>
<mirror>
<mirrorOf>central</mirrorOf>
<name>central</name>
<url>http://my-nexusorartifactory/artifactory/libs-releases</url>
<id>central</id>
</mirror>
<mirror>
<mirrorOf>snapshots,snapshot</mirrorOf>
<name>snapshots</name>
<url>http://my-nexusorartifactory/artifactory/libs-snapshots</url>
<id>snapshots</id>
</mirror>
</mirrors>
此repo可用作codehaus的替代:https://nexus.codehaus.org/content/groups/public/
更多信息:Codehaus Maven Repository Usage Guide (web.archive.org mirror)