2

发生以下问题:一旦我打开 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确实出了点问题。

4

2 回答 2

3

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

于 2013-07-14T08:15:14.607 回答
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解决问题。

于 2017-05-10T12:21:05.440 回答