对于玻璃鱼依赖,maven构建失败了

时间:2012-06-12 01:30:23

标签: maven glassfish dependency-management pom.xml

我在Maven构建中始终遇到以下错误。我无法弄清楚发生了什么。什么是技术解释?

Downloading: http://maven.glassfish.org/content/groups/glassfish/com/sun/jersey/jersey-project/1.2/jersey-project-1.2.pom
185b downloaded  (jersey-project-1.2.pom)
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = '6c9fd3d150b8a5f0ca676f49b8ed603793cabebb'; remote = '<html>
<head><title>301' - RETRYING
Downloading: http://maven.glassfish.org/content/groups/glassfish/com/sun/jersey/jersey-project/1.2/jersey-project-1.2.pom
185b downloaded  (jersey-project-1.2.pom)
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = '6c9fd3d150b8a5f0ca676f49b8ed603793cabebb'; remote = '<html>
<head><title>301' - IGNORING
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: null:jersey-server:bundle:null

Reason: Cannot find parent: com.sun.jersey:jersey-project for project: null:jersey-server:bundle:null for project null:jersey-server:bundle:null


[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Unable to get dependency information: Unable to read the metadata file for artifact 'com.sun.jersey:jersey-server:jar': Cannot find parent: com.sun.jersey:jersey-project for project: null:jersey-server:bundle:null for project null:jersey-server:bundle:null
  com.sun.jersey:jersey-server:jar:1.2

3 个答案:

答案 0 :(得分:0)

我遇到了同样的问题,事实上,glassfish存储库已经是301.所以如果我们可以先使用中央存储库,就不会出现这些问题。现在我的方法是修改使用glassfish存储库的pom文件。删除有关存储库的一些行。那么这次可以工作。但很快又出现了另一个问题,那么多pom包含了玻璃鱼。我修改下一个。哦,太多了。

答案 1 :(得分:0)

请检查您本地存储库中的jersey-project pom文件     〜/平方米/库/ COM /阳光/汗布/球衣项目/ 1.2 /新泽西州项目1.2.pom     C:\ Users \用户的.m2 \库\ COM \太阳\球衣\球衣项目\ 1.2 \ Jersey的项目1.2.pom

POM内容可能不正确,如下,

<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/0.6.39</center>
</body>
</html

只需删除POM文件(或只是delet jersey目录),然后重试,你就会解决这个问题

答案 2 :(得分:0)

参考这个答案 https://stackoverflow.com/a/27248395/1122841

正如我所建议的那样,我在settings.xml中添加了镜像细节(在maven的config目录中) 删除.m2 / repository / com / sun / jersey,以便删除以前下载的jar或poms 并再次建造项目。它成功地下载了所有东西。