2010-05-31 85 views
2

在Maven构建过程中,我得到了缺失的工件错误,因为其中一个依赖声明使用该属性的父工件。现在物业本身在父POM是声明,我的项目的构建失败给这个错误:Maven中缺少工件错误

[ERROR] Failed to execute goal on project abc: Unable to get dependency 
information for xyz:pqr:jar:SNAPSHOT: Failed to process POM for 
xyz:pqr:jar:SNAPSHOT: Non-resolvable parent POM xyz:pqr-parent:${someversion} 
for xyz:pqr:${someversion}: Failed to resolve POM for 
xyz:pqr-parent:${someversion} due to Missing: 
---------- 
1) xyz:pqr-parent:pom:${someversion} 
---------- 
1 required artifact is missing. 

for artifact: 
xyz:pqr-parent:pom:${someversion} 

我已验证了文物存在于存储库中的正确位置。

有没有办法指定在dependency pom中使用的someversion属性的值? 如果不是,应如何更改依赖项来解决错误?

回答

4

I get a missing artifact error during Maven build because one of the dependencies declares it's parent artifact using a property for the version. Now the property itself is declared in the parent pom and my project's build fails giving this error (...)

这是一个鸡和鸡蛋的问题:您无法从父级获取父级版本。

Is there a way to specify the value of someversion property used in the dependency pom?

AFAIK,这是不可能的,project.parent.version中的属性不会被替换。您可能需要检查MNG-624(并为其投票)和相关问题。

If not, how should the dependency pom be changed to resolve the error?

在project.parent.version中使用“硬编码”版本。