我安装了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”。
?
问题解决。
?
?