0

我们有下一个项目结构:

父Pom.xml

  • 项目

  • 流库项目

    • streambaseParentPom.xml

      • 项目1

      • project2(具有 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]

提前致谢。

4

1 回答 1

0

恐怕它不会那样工作。参数化该<version>值是一个坏主意,因为即使您设法将其部署到远程仓库,以后使用该工件的任何项目都不知道${cerebro.version}应该解决什么问题。

请记住,Maven 努力使您的构建保持可重复性。如果构建依赖于部署时已知但依赖项未知的某个变量,则您的构建将不再可重现。

于 2017-01-13T13:53:41.497 回答