我们有下一个项目结构:
parentPom.xml
- streambaseParentPom.xml - project1
- project2 (has dependency of project1)
因此,我们有一个parentPom,它继承到streambaseParentPom,最后一个继承到所有streambase项目。因此,我们在parentPom中设置了一个名为cerebro.version的属性,该属性定义了父版本。当我们将project1作为其他项目的依赖项时,我们会遇到问题,我们将收到下一个错误消息:
[ERROR] Failed to execute goal on project eFX-SB7-Pricing: Could not resolve dependencies for project com.santander.fx:eFX-SB7-Pricing:jar:3.14.10.0.4-SNAPSHOT:
Failed to collect dependencies at com.santander.fx:eFX-SB7-Common:jar:3.14.10.0.4-SNAPSHOT:
Failed to read artifact descriptor for com.santander.fx:eFX-SB7-Common:jar:3.14.10.0.4-SNAPSHOT:
Could not transfer artifact com.santander.fx:eFX-SB7-Parent:pom:${cerebro.version} from/to eFX-External-Repository (http://lnx-efxbuild2.ants.ad.anplc.co.uk:8081/artifactory/ext-release-local):
Illegal character in path at index 109: http://lnx-efxbuild2.ants.ad.anplc.co.uk:8081/artifactory/ext-release-local/com/santander/fx/eFX-SB7-Parent/${cerebro.version}/eFX-SB7-Parent-${cerebro.version}.pom -> [Help 1]提前谢谢。
发布于 2017-01-13 13:53:41
恐怕不是那样的。参数化<version>值是个坏主意,因为即使您成功地将它部署到远程回购中,以后使用该工件的任何项目都不会知道${cerebro.version}应该解决什么问题。
记住,Maven努力工作以保持构建的可复制性。如果构建依赖于某个在部署时已知的变量,但对于受抚养人则未知,则您的构建将不再是可重复的。
https://stackoverflow.com/questions/41634696
复制相似问题