簡體   English   中英

父版本的Maven子依賴項錯誤

[英]Maven child dependency error with parent version

我們有下一個項目結構:

parentPom.xml

  • Java項目

  • 流基項目

    • streambaseParentPom.xml

      • PROJECT1

      • 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]

提前致謝。

恐怕它不能那樣工作。 參數化<version>值是一個壞主意,因為即使您設法將它部署到遠程${cerebro.version} ,以后使用該工件的任何項目也都不會知道${cerebro.version}應該解決什么。

請記住,Maven會努力使您的構建可再現。 如果構建依賴於部署時已知但依賴項未知的某個變量,則您的構建將不再具有可復制性。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM