【问题标题】:Maven errors and build faliureMaven 错误和构建失败
【发布时间】:2013-07-11 03:37:57
【问题描述】:

出现以下问题:打开 Ecipe 后,所有项目都用红色 X 签名。打开项目树,节点中没有错误符号。 Nothig 向我展示了导致错误的原因。我无法构建项目。最后,我为 Eclipse 创建了一个新工作区,从 SVN 签出项目,将它们作为 Maven 项目导入。 (有两个主要项目和几个子项目。) 还有两个项目显示红色 X,但未显示导致错误的原因。我试图在 Eclipse 中刷新、清理。我也无法毫无错误地构建其他项目,当然也不能构建有错误的项目。错误信息例如:

    [WARNING] Some problems were encountered while building the effective model for hu.bz.ikti.insurance:SAMCommon:jar:0.0.1-SNAPSHOT  
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ hu.bz.ikti.insurance:InSurance:0.0.1-SNAPSHOT, C:\Dev\workspace\InSurance\pom.xml, line 27, column 12  
[WARNING]   
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.  
[WARNING]   
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.  
[WARNING]   
[INFO]                                                                           
[INFO] ------------------------------------------------------------------------  
[INFO] Building SAM-függő közös osztályok 0.0.1-SNAPSHOT  
[INFO] ------------------------------------------------------------------------  
[WARNING] The POM for hu.bz.ikti:common:jar:0.0.1-SNAPSHOT is missing, no dependency information available  
[INFO] ------------------------------------------------------------------------  
[INFO] BUILD FAILURE  
[INFO] ------------------------------------------------------------------------  
[INFO] Total time: 1.110s  
[INFO] Finished at: Fri Jul 12 11:33:33 CEST 2013  
[INFO] Final Memory: 4M/114M  
[INFO] ------------------------------------------------------------------------  
[ERROR] Failed to execute goal on project SAMCommon: Could not resolve dependencies for project hu.bz.ikti.insurance:SAMCommon:jar:0.0.1-SNAPSHOT: Could not find artifact hu.bz.ikti:common:jar:0.0.1-SNAPSHOT -> [Help 1]  
[ERROR]   
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.  
[ERROR] Re-run Maven using the -X switch to enable full debug logging.  

对于错误的项目部分消息是:

    [ERROR] Failed to execute goal on project Service: Could not resolve dependencies for project hu.bz.ikti.insurance:Service:jar:0.0.1-SNAPSHOT: Failed to collect dependencies for [org.springframework:spring-context:jar:3.1.2.RELEASE (compile), org.springframework:spring-core:jar:3.1.2.RELEASE (compile), org.springframework:spring-beans:jar:3.1.2.RELEASE (compile), commons-dbcp:commons-dbcp:jar:1.4 (compile), postgresql:postgresql:jar:9.1-901-1.jdbc4 (compile), org.springframework:spring-tx:jar:3.1.2.RELEASE (compile), hu.bz.ikti.insurance:Model:jar:0.0.1-SNAPSHOT (compile), org.springframework:spring-orm:jar:3.1.2.RELEASE (compile), hu.bz.ikti:service-base:jar:0.0.1-SNAPSHOT (compile), org.springframework:spring-test:jar:3.1.2.RELEASE (compile), org.apache.maven.plugins:maven-compiler-plugin:jar:3.1 (compile)]: Failed to read artifact descriptor for hu.bz.ikti.insurance:Model:jar:0.0.1-SNAPSHOT: Could not transfer artifact hu.bz.ikti.insurance:Model:pom:0.0.1-SNAPSHOT from/to ikti (https://fcd3.ikti.hu/artifactory/ext-release-local): Failed to transfer https://fcd3.ikti.hu/artifactory/ext-release-local/hu/bz/ikti/insurance/Model/0.0.1-SNAPSHOT/Model-0.0.1-SNAPSHOT.pom. Error code 409, The repository 'ext-release-local' rejected the artifact 'ext-release-local:hu/bz/ikti/insurance/Model/0.0.1-SNAPSHOT/Model-0.0.1-SNAPSHOT.pom' due to its snapshot/release handling policy. -> [Help 1]  

谁能帮帮我?

已编辑:

什么意思:

您正在尝试将快照版本 (Model-0.0.1-SNAPSHO‌​T.pom) 部署到仅发布版本的存储库 ext-release-local 中? 选择一个快照存储库(例如 ext-snapshot-local)而不是一个发行版。

我应该更改我的 pom.xml 吗?如何?我不明白它以前怎么可能工作,但现在出现了这个编译问题。还有什么可以改变的?我没有改变任何意图。

已编辑 2

我还注意到 .m2 文件夹下的 settings.xml 不存在。 Maven 确实出了点问题。

【问题讨论】:

  • 消息的重要部分是“错误代码 409,存储库 'ext-release-local' 拒绝了工件 'ext-release-local:hu/bz/ikti/insurance/Model/0.0. 1-SNAPSHOT/Model-0.0.1-SNAPSHOT.pom' 由于其快照/发布处理策略。”检查远程仓库(Nexus、Artifactory 或其他)以找出问题所在。

标签: maven build dependencies


【解决方案1】:

我偶然发现这篇文章有一个稍微不同的问题:我们尝试将工件 artifact-1.2.1.jar 部署到快照存储库并收到此错误:

org.artifactory.api.repo.exception.RepoRejectException: Cannot deploy file
'artifact-1.2.1.jar'. The repository 'repo_snapshot' rejected the resolution
of an artifact 'repo_snapshot:xxx/artifact/1.2.1/artifact-1.2.1.jar' due to 
conflict in the snapshot release handling policy.

我们的问题是 SNAPSHOT 不是工件文件名的一部分,因此将其重命名为 artifact-1.2.1-SNAPSHOT.jar 解决了这个问题。

【讨论】:

    【解决方案2】:

    正如@user944849 提到的,409 是重要的部分。 您正在尝试将快照版本 (Model-0.0.1-SNAPSHO‌​T.pom) 部署到仅限发布的存储库 ext-release-local,因此会发生冲突。 选择一个快照存储库(例如ext-snapshot-local)而不是一个发行版。

    【讨论】:

    • 大家好,我的问题已经解决。我们的存储库出现了一些问题。我删除了对此的引用。之后我就可以编译所有项目了。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-26
    • 1970-01-01
    相关资源
    最近更新 更多