发生了以下问题:一旦我打开Eclipe,所有的procects都用红色X签名。打开projet树,节点中没有错误标志。 Nothig向我展示了导致错误的原因。我无法建立项目。最后,我为Eclipse创建了一个新的工作区,从SVN中检出项目,将它们作为Maven项目导入。 (有两个主要和几个儿童项目。) Ther仍然有两个项目显示红色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)而不是第1版。
我应该更改我的pom.xml吗?怎么样?我不明白它之前是如何工作的,但现在有这个编译问题。还有什么可以改变的?我没有改变任何意图。
已编辑2
我还注意到.m2文件夹下的settings.xml不存在。 Maven确实出了问题。
答案 0 :(得分:3)
如@ user944849所述,409是重要的部分。
您正尝试将快照版本(Model-0.0.1-SNAPSHOT.pom
)部署到仅发布的存储库ext-release-local
中,从而产生冲突。
选择快照存储库(例如ext-snapshot-local
)而不是第1版。
答案 1 :(得分:1)
我偶然发现了一篇略有不同的问题:我们尝试将工件artifact-1.2.1.jar
部署到Snapshot存储库并出现此错误:
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
解决了这个问题。