Maven "Unable to read local copy of metadata" problem - koen ...

我安装了ubuntu之后,编译maven工程报错,大概内容是"can't read [mvn_local_rep]/org/glassfish/javax.enterprise.deploy/10.0-SNAPSHOT/xxx.pom"。错误信息类似下面这样:

?

Reason: Error getting POM for 'org.apache.maven.plugins:maven-site-plugin' from the repository: Unable to read local copy of metadata: Cannot read metadata from '/home/usr/.m2/repository/org/glassfish/javax.enterprise.deploy/10.0-SNAPSHOT/xxx.pom': end tag name </body> must match start tag name <hr> from line 7 (position: TEXT seen ...</address>\n</body>... @9:8)

?

查看该文件发现内容类似如下:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved here.</p>
<hr>
<address>Apache Server at maven2-repository.dev.java.net Port 443</address>
</body></html> 

网上搜索也没有结果。{zh1}想到应该是目前所用的repository中没有正确的 artifact “/org/glassfish/javax.enterprise.deploy/10.0-SNAPSHOT”,要解决该问题就要指向一个包含该aritifact的repository。我尝试在settings.xml中加入以下内容:

    <mirror>

      <id>glassfish</id>

      <url>http://maven.dyndns.org/glassfish/</url>

      <mirrorOf>*</mirrorOf>

    </mirror>
?

其中的“http://maven.dyndns.org/glassfish/”包含有我需要的artifact “/org/glassfish/javax.enterprise.deploy/10.0-SNAPSHOT”。

?

问题解决。

?

?

郑重声明:资讯 【Maven "Unable to read local copy of metadata" problem - koen ...】由 发布,版权归原作者及其所在单位,其原创性以及文中陈述文字和内容未经(企业库qiyeku.com)证实,请读者仅作参考,并请自行核实相关内容。若本文有侵犯到您的版权, 请你提供相关证明及申请并与我们联系(qiyeku # qq.com)或【在线投诉】,我们审核后将会尽快处理。
—— 相关资讯 ——